Groovy Script
Explanation
This script performs the following operations:- Form Data Preparation: Prepares URL parameters in
application/x-www-form-urlencodedformat. - HTTP Connection: Creates a connection for HTTP POST request.
- Content-Type Setting: Sets the
application/x-www-form-urlencodedContent-Type. - Data Sending: Sends form data as POST body.
- Response Processing: Processes and uses the response in JSON or text format.
Usage Scenario
This script can be used in operations such as obtaining OAuth tokens. Parameters are sent in form data format and the returned access token is added to the header.This script should be run on the request line (Request Policy) because it uses the
requestHeaderMapToTargetAPI variable.
