Configuring HTTP Requests in HTTP Client
HTTP Method
Choose the HTTP method for your request using the dropdown box near the URL text field. Supported methods include:
- GET
- POST
- PUT
- PATCH
- DELETE
- HEAD
- OPTIONS
- TRACE
Request URL
Enter the request URL in the adjacent text field. The HTTP Client validates URLs in real-time, displaying a red 'x' for invalid URLs. A properly formatted HTTP/S URL is essential.
Parameters
Under the Parameters tab, manage both query and path parameters of your request. This tab displays three columns: Name, Value, and Description.
Adding and Removing Parameters
- To add a query parameter, click the green '+' button or edit the URL directly.
- Delete a parameter by selecting it and pressing the red 'x' button or the delete key.
- Path parameters are added or removed by editing the URL.
Modifying Parameters
- Double-click a cell to edit a parameter’s name, value, or description.
- Press enter to submit changes or expand the text area with the '...' button.
Request Body
Configure the request payload in the Body tab. Select the type of request payload and specify the content. Supported content types include:
- text/plain
- form-data
- application/json
- application/xml
- application/x-yaml
- multipart/form-data
- application/x-www-form-urlencoded
- binary
Payload Types
form-data
: Holds multiple key-value pairs, either text or binary.application/x-www-form-urlencoded
: Similar toform-data
but accepts only text values.- Text payload: Configurable for various markup formats with syntax coloring.
- Binary payload: Used for sending binary files.
Request Headers
Configure request headers, which are key-value pairs, under the Headers tab. Add a new header with the green '+' button, and remove one with the red 'x' button or delete key. Content-assist is available for header names and values.
Request Cookies
Manage request cookies, similar to headers, under the Cookies tab.
Authentication
Configure authentication for secured services in the Authentication tab. Supported schemes include Basic, OAuth 1.0, OAuth 2.0, and Martini session authentication.
Authentication Types
- Basic: Sends
username:password
in Base64-encoded format. - OAuth 1.0 and 2.0: Use tokens instead of passwords for authorization.
- Martini session: Uses an active Martini session ID.
Using Mock Data
Automate data input using mock data. Specify fields to mock using variable references like [[variableName]]
. Mock data can be used in various parts of the request, including parameters, headers, and body.