HttpUnit
Send http requests with sublime rather than tools like PostMan. Syntax hilight, Comment supported
Details
Installs
- Total 338
- Win 172
- Mac 102
- Linux 64
| Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
HttpUnit
An alternate of PostMan. No gui, but pretty easy to send http requests in sublime. We can find the Documentation here. Please report any issue here.
Features
- The syntax is similar to HTTP protocol.
- Comment supported.
- Syntax hilight.
The Simplest Request
Create a file named with “test.req”, with content.
GET https://www.google.com/
Save, press Command+B or Ctrl+B to run to send the request.
Form Submission/File Upload
// lines begin with double slashes will be ignored
// post-example
// request line:
POST http://test.com/show_post.php
// [optional] query strings, will be added to the request line as the query string
act=login
controller=user
// [optional] options, used to control the behavious of `HttpUnit`
@timeout=1000
@header_in=1
@header_out=0
// [optional] http headers, will be added to the http header
Token: hello
Cookie: sessionid=anysessionid
// [optional] body
// The following "--" indicates the the beginning of request body
--
// Simple Kv
username: gaohuias
password: 123456
// File upload, values start with "@" will be considered as a file path
image: @/Users/tom/images/2114647.jpeg
--
// The "--" above indicates the ending of a request
// The subquent requests can begin from here.
Post JSON/Raw Data
// post-raw/json
// Request Line:
POST http://test.com/show_post.php
// indicts the content type, it's optional
Content-Type: application/json
// [optional] body
// The "--raw" indicates the beginning of the body too. But the content will be put in the http body without any changes.
--raw
{
"username" : "gaohuia"
}
--
Config File
You can build a config file named requester.json under the project directory, and put any options in it, which will be applied to all requests under the project automatically.
Example:
{
"header_in" : 0,
"header_out" : 0
}
Valid options
@timeoutThe maximum number of milliseconds to allow cURL functions to execute. Default: unlimited@header_in0/1 to control the output of the response header. Default: 1.@header_out0/1 to control the output of the request header. Default: 1.@authAuth method to use, valid values: basic, digest.@userpwdUser && Pass to use, in format of “user:pass”.
Dependencies
- PHP 7.0+
HOT KEYS
Just press Command+B (For Mac) or Ctrl+B (For Win) to run your script.
Install
The simplest way to install HttpUnit would be through the Package Control.
- Press
Command+Shift+P, type int “Install Package” and pressEnter. - Type in “Http Unit” and press
Enter. - That is all you need to do. Enjoy!
Alternative Way:
Press Ctrl+ Copy the following code, parst and press enter.
import urllib.request,os,hashlib,tempfile,zipfile,shutil; version = "1.2.0"; name = "HttpUnit"; url = "https://github.com/gaohuia/HttpUnit/archive/v%s.zip" % (version); pp = sublime.packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen(url).read(); io = tempfile.TemporaryFile(); io.write(by); temp_dir = tempfile.gettempdir(); z = zipfile.ZipFile(io); z.extractall(temp_dir); shutil.copytree(temp_dir + "/" + name + "-" + version, pp + "/" + name); io.close();