Closure Compiler – Postman Request

What is the Closure Compiler?

The Closure Compiler is a tool for making JavaScript download and run faster. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what’s left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.

ref: https://developers.google.com/closure/compiler/

Clsoure RESTFul API end point – http://closure-compiler.appspot.com/compile

CURL request –

curl “http://closure-compiler.appspot.com/compile” -H “Origin: null” -H “Accept-Encoding: gzip, deflate” -H “Accept-Language: en-US,en;q=0.8,es;q=0.6” -H “Upgrade-Insecure-Requests: 1” -H “User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36” -H “Content-Type: application/x-www-form-urlencoded” -H “Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8” -H “Cache-Control: max-age=0”  -H “Connection: keep-alive” -H “DNT: 1” –data “js_code=++++function+hello”%”28name”%”29+”%”7B”%”0D”%”0A++++++”%”2F”%”2F+Greets+the+user”%”0D”%”0A++++++alert”%”28″%”27Hello”%”2C+”%”27+”%”2B+name”%”29″%”3B”%”0D”%”0A++++”%”7D”%”0D”%”0A++++hello”%”28″%”27New+user”%”27″%”29″%”3B”%”0D”%”0A++++&compilation_level=WHITESPACE_ONLY&output_format=text&output_info=compiled_code” –compressed

To import CURL to Postman -> select Import Raw Text and paste it.

postman_curl_closure