# POST Bodies

{% hint style="info" %}
When sending a HTTP `POST`, you may present your arguments as either standard POST parameters or use `multipart/form-data` if file are included.
{% endhint %}

## URL Encoded

When sending URL- encoded data, set your HTTP `Content-Type` header to `application/x-www-form-urlencoded` and present your key/value pairs according to [RFC-3986](https://tools.ietf.org/html/rfc3986).

For example, a`POST`request to create a section might look something like this:

```http
POST /api/blocks/<SECTION_ID>/sections HTTP/1.1
Accept: application/json
X-MBurger-Token: <TOKEN>
X-MBurger-Version: <VERSION>
Content-Type: application/x-www-form-urlencoded; charset=utf-8

elements[en][title]=Awesome+Title&elements[en][content]=Awesome+Content&elements[en][title]=Titolo&elements[en][content]=Contenuto
```

In this example, you are creating one section with two elements `title` and `content` both in English and Italian.

{% hint style="warning" %}
As you can see, every key of an element **must** be in the form of  `elements[LOCALE][ELEMENT_NAME]`
{% endhint %}

## Multipart Encoded

If you have to send files you must use `multipart/form-data`. An example:

```http
POST /api/blocks/<SECTION_ID>/sections HTTP/1.1
Accept: application/json
X-MBurger-Token: <TOKEN>
X-MBurger-Version: <VERSION>
Content-Type: multipart/form-data; charset=utf-8; boundary=YOUR_BOUNDARY

--YOUR_BOUNDARY
Content-Disposition: form-data; name="elements[en][title]"

Title
--YOUR_BOUNDARY
Content-Disposition: form-data; name="elements[en][image][0]"; filename="image1.jpg"
Content-Type: image/jpeg

<IMAGE_DATA>
--YOUR_BOUNDARY
Content-Disposition: form-data; name="elements[en][image][1]"; filename="image2.jpg"
Content-Type: image/jpeg

<IMAGE_DATA>
--YOUR_BOUNDARY--
```

In this example, you are creating one section with two elements `title` and `image` only in English.

{% hint style="warning" %}
As you can see, every key of a media element (*image*, *audio*, *video*, *document*, *file*) **must** be in the form of `elements[LOCALE][ELEMENT_NAME][INDEX]`.
{% endhint %}

{% hint style="info" %}
Instead ***relation*** elements doesn't require a locale so the key **must** be in the form of `ELEMENT_NAME[INDEX]`

You can see an example in the [Relations](https://docs.mburger.cloud/api-docs/common/relations) section :wink:&#x20;
{% endhint %}

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mburger.cloud/api-docs-1/common/post-bodies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
