Learn how to add query parameters, path variables, and request body data to your API requests in Requestly.
Parameters and request bodies allow you to send data with your API requests. This guide covers query parameters, path variables, and different request body formats.
Path variables allow you to define dynamic segments in your API URL using the :variableName syntax. This is useful for RESTful APIs where resource identifiers are part of the URL path.For example, if your API endpoint is:
Requestly automatically detects the path variables (:userId and :postId) from the URL and displays them in the Params tab under Path Variables. You can then set values for each variable:
Key
Value
Description
userId
123
The user’s unique identifier
postId
456
The post’s unique identifier
When you send the request, Requestly compiles the URL with your provided values:
https://api.example.com/users/123/posts/456
Path variables are automatically extracted from your URL. Simply type a URL with :variableName segments, and they’ll appear in the Path Variables table for you to fill in.
In the Query Params section, you can add query parameters as key-value pairs to send extra information with the URL. To add more parameters, click on the + Add More button.Each query parameter consists of:
Key: The parameter name
Value: The parameter value
Type: An enum to enforce the value type
Description (optional): Internal documentation explaining the purpose of the parameter
For example:
Adding uid=123 to https://app.requestly.io/echo results in: https://app.requestly.io/echo?uid=123
The checkboxes next to each parameter let you include or exclude them without deleting them. For instance, if you uncheck a parameter, the final URL will not include it.
For POST, PUT, or PATCH requests, use the Body tab to send data to the server. Requestly supports multiple body formats to accommodate different API requirements.
Each row has a Content-Type column. It sets the Content-Type header of that
one part. Text rows and file rows both support it.Use it when an API needs a typed part. The common case is one JSON metadata part
plus one file part in the same request:
BOUNDARY is the delimiter Requestly generates. It also appears in the
request-level Content-Type header, as multipart/form-data; boundary=BOUNDARY.
Leave the field empty to use the default. The placeholder shows Auto. An empty
value on a text row sends no Content-Type header for that part. An empty
value on a file row sends application/octet-stream.
Requestly does not validate the value. You can enter any string, including an
invalid MIME type, because a wrong content type is sometimes the case under test.Postman imports and exports carry this field on text rows, so the value survives a
round-trip. File rows are a separate matter: Requestly cannot export the local file
itself, so re-attach files after an import.Generated code snippets carry the value in curl: each typed part gains
;type=<value> in its --form argument. Other snippet languages follow their
generator’s capability. python/requests keeps the type on file parts and drops
it on text parts. Most other languages do the same. A few drop it on both
parts, and a few keep it on both. Check the generated snippet before you rely
on it for a typed part.
For GraphQL APIs, use the dedicated GraphQL request type which provides:
Query/Mutation editor with syntax highlighting
Variables panel
Schema introspection, or a schema you attach yourself from a file or a URL
Requestly will automatically add certain headers to your requests based on your request body selections. When you add a request body, Requestly automatically sets the appropriate Content-Type header:
Body Type
Content-Type Header
RAW (JSON)
application/json
RAW (Text)
text/plain
RAW (XML)
application/xml
RAW (HTML)
text/html
RAW (JavaScript)
application/javascript
x-www-form-urlencoded
application/x-www-form-urlencoded
multipart/form-data
multipart/form-data
You can view and override the autogenerated headers in the Headers tab. These headers are automatically managed by Requestly to ensure your requests are properly formatted.