Skip to main content

Rest Client Samples

@ct_json = application/json
@ct_form = application/x-www-form-urlencoded
@baseUrl = http://127.0.0.1:9527/app
@custom_header = {"foo":"bar"}

### FILE
POST {{baseUrl}}/file/upload HTTP/1.1
Custom_Header: {{custom_header}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryAdPWB9y8gDZKEaVv

------WebKitFormBoundaryAdPWB9y8gDZKEaVv
Content-Disposition: form-data; name="file"; filename="dependencies.txt"
Content-Type: application/octet-stream

< /Users/beyond/Downloads/dependencies.txt
------WebKitFormBoundaryAdPWB9y8gDZKEaVv--

### GET
GET {{baseUrl}}/get HTTP/1.1
Content-Type: {{ct_form}}
Custom_Header: {{custom_header}}

### GET with query
GET {{baseUrl}}/query?foo=bar HTTP/1.1
Content-Type: {{ct_form}}
Custom_Header: {{custom_header}}

### POST with form body
POST {{baseUrl}}/form HTTP/1.1
Content-Type: {{ct_form}}

name=foo
&password=bar

### POST with raw body
POST {{baseUrl}}/track/line/resolve HTTP/1.1
Content-Type: {{ct_json}}
USER_INFO_HEAD: {{hong_kai}}

["foo", "CMDU12345678"]