Appearance
Request body
The Body tab holds the data you send with POST, PUT and PATCH requests. Choose a body type from the drop-down at the top of the tab.
Body types
| Type | Use it for |
|---|---|
| None | Requests without a body. The tab shows This request does not have a body. |
| Raw (JSON/Text) | JSON, XML or plain text typed into a code editor. |
| Form Data | Key/value fields sent as multipart/form-data. |
| URL Encoded | Key/value fields sent as application/x-www-form-urlencoded, like an HTML form. |
Changing the type clears the body
Switching to another body type empties the body. If you switch by mistake and haven't saved, close the tab and choose Discard — the saved body is back when you reopen the request.
Raw body
- Choose Raw (JSON/Text).
- Type or paste the body into the editor.
Collapy detects the format from what you type and shows it in the editor's top-right corner: JSON, XML or Text. There's no format picker — valid JSON is shown as JSON, content that starts with < is shown as XML, and everything else is Text.
- Format pretty-prints the body. It works for JSON and XML and is greyed out for plain text or an empty body.
- The search button finds text in the body. You can also press
Ctrl+F(Cmd+Fon macOS) twice: the first press searches the response, the second the request body. - Type
{{to insert an environment variable, for example:
json
{
"email": "jane@example.com",
"plan": "{{defaultPlan}}"
}Variables outside quotes
A body like {"id": {{userId}}} isn't valid JSON until the variable is filled in, so the editor labels it Text and Format is greyed out. Collapy still sends it as JSON when the resolved body is valid JSON.
Form Data and URL Encoded
Both types use a table with Key and Value columns.
- Untick a row's checkbox to keep it without sending it.
- Rows with an empty key aren't sent.
- Keys and values can contain
{{variables}}. - Values are text only. File upload isn't supported.
With URL Encoded, keys and values are percent-encoded for you — type a b and Collapy sends a%20b.
Content-Type
If you haven't added a Content-Type header yourself, Collapy sets one based on the body:
| Body | Content-Type sent |
|---|---|
| Raw, valid JSON | application/json |
| Raw, anything else (including XML) | text/plain |
| Form Data | multipart/form-data; boundary=… |
| URL Encoded | application/x-www-form-urlencoded |
| None, or an empty body | No body and no Content-Type |
A Content-Type you add on the Headers tab always wins. For XML, add Content-Type: application/xml (or whatever your API expects), because Collapy sends XML as text/plain by default.
GET and DELETE requests
Collapy doesn't send a body with GET or DELETE requests. You can still fill in the Body tab — the body is kept with the request and is sent if you change the method to POST, PUT or PATCH.
FAQ
Can I upload a file?
No. File upload isn't supported. Form Data fields are text only.
Why is my XML sent as text/plain?
Collapy only recognises JSON automatically. Add a Content-Type header on the Headers tab to send XML with the right type.
