add http header
Add a key/value pair as an HTTP header field that you might want to include with your request.
Name | Description | Type | Modifier |
---|---|---|---|
key | Name of the header field. | String | None |
value | (Optional) Value of the header field | String | None |
None
This action may be used within the following project items: test modules and user-defined actions.
Suppose that you'd like to test a Google Maps API with the following header fields:
Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
Authorization: Basic Sm9obi5TBWI0aDpwQHNzd29yZA==
Host: maps.googleapis.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1(java1.5)
name value
local variable uri http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
 
create http request
 
key value
add http header Accept-Encoding gzip;q=1.0, identity; q=0.5, *;q=0
add http header Authorization Basic Sm9obi5TBWI0aDpwQHNzd29yZA==
add http header Host maps.googleapis.com
add http header Connection Keep-Alive
add http header User-Agent Apache-HttpClient/4.1.1(java1.5)
 
uri method timeout variable expected code
send http request # uri GET 200 >>response 200
- An HTTP request must be instantiated via create http request before calling this built-in action.
- Refer to here for syntax and semantics of all standard HTTP header fields. In general, each header field consists of a name followed by a colon (":") and the field value.
- This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of any of the arguments, or any argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.