add http parameter
Add a parameter including a pair of key/value to a GET request. Note that, this parameter will be added to the query string in the requester URL. For example: http://example.com/reseource/path/search?name=value
Name | Description | Type | Modifier |
---|---|---|---|
key | Name of the parameter. | String | None |
value | (Optional) Value of the parameter. | String | None |
None
This action may be used within the following project items: test modules and user-defined actions.
- Option #1: Use add http parameter to add pairs of name/value into the GET request.
create http request   key value add http parameter firstName John add http parameter lastName Doe   uri method variable expected code send http request http://www.acme.com/phonebook/UserDetails GET >>response 200
- Option #2: Use send http request to append pairs of name/value into the URI of the GET request.
create http request   uri method variable expected code send http request http://www.acme.com/phonebook/UserDetails?firstName=John&lastName=Doe GET >>response 200
- An HTTP request must be instantiated via create http request before calling this built-in action.
- To add multiple value parameters into the URI of the GET request, in your test procedures declare several add http parameter. These name/value pairs are joined with equal signs and different pairs are separated by the ampersand. For example: /test/demo_form.asp?name1=value1&name2=value2.
- Alternatively, when you do not want to use this built-in action to add a name/value pair into the GET request, append the name/value pair directly into the URI and then send the entire GET request to the server by using the send http request built-in action. (See )
- 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.