Create Request Body

Help Topics
In request item properties, you can click button Create to create request body in a user-friendly way (this feature is also supported in basic request window). It is even possible to create request body from an existing HTML data.

Create request body from an existing HTML data

HTML data can be obtained from the following sources:
  • Internet address (URL).
  • File on the disk.
To obtain an existing HTML data, enter the location to extract HTML tags from and click corresponding toolbar button. If obtained HTML data contains FORM elements, the list will display all input elements contained inside these FORM elements. You can also manually add additional elements to the list or remove unwanted elements from it. For each element in the list the following options can be specified:
  • Element name.
  • Element value.
  • URL encode; if turned on, name and value of an element will be URL encoded with the project's request encoding. This ensures that name and value inside request body are properly URL encoded.
  • Global project parameter name; if specified, parameter will be automatically created and applied inside the request body for the element. For example, if there is a SELECT element with three OPTION elements, created parameter will contain three values obtained from the value attribute of those three OPTION elements. The parameter will also automatically be set as the value for the corresponding element inside the request body.

Format of the built request body

It is possible to specify what kind of output data should be created for the response body. To specify the desired output format, select appropriate option from the drop down available in the toolbar. The following options are available:
  • String with key-value pairs; this should be used for the most common HTML form submit with key-value pairs. Content type is usually application/x-www-form-urlencoded.
  • Multipart form data; this should be used for submitting HTML form that includes file uploads. Content type is usually multipart/form-data.
  • JSON object; this should be used for posting JSON object; specified element name will be used for JSON property name, specified element value will be used for JSON property value. Content type is usually application/json.
  • XML document; this should be used for posting XML document; specified element name will be used for XML element name, specified element value will be used for XML element value, name of the root element will be data. Content type is usually application/xml.