Question: I'm trying to post a comment on the merge request but I get the error `{"error":"body is missing"}`. Any idea how I can resolve this?

```
curl --request POST --header "Private-Token: askljdhakjdlsa" http://10.10.10.10/api/v4/projects/9/merge_requests/67/notes --data '{ "body": "Comment test" }'

```

Answer: 
I think you missed [Restful API Styleguide for JSON](https://docs.gitlab.com/ee/development/documentation/restful_api_styleguide.html#post-data-using-json-content). Styleguide says you need to pass another header `Content-Type: application/json` like

```
curl --request POST --header "Private-Token: askljdhakjdlsa" --header "Content-Type: application/json" --data '{ "body": "Comment test" }' http://10.10.10.10/api/v4/projects/9/merge_requests/67/notes 

```

If you do not want to use `JSON` data then(by default `Content-Type` header will be `application/x-www-form-urlencoded`)

```
curl --request POST --header "Private-Token: askljdhakjdlsa" --data "body=Comment test" http://10.10.10.10/api/v4/projects/9/merge_requests/67/notes 

```
Considering the [Create new merge request note](https://docs.gitlab.com/ee/api/notes.html#create-new-merge-request-note), an alternative to `application/x-www-form-urlencoded` (mentioned in [Arif Khan](https://stackoverflow.com/users/3461055/arif-khan)'s [answer](https://stackoverflow.com/a/69550490/6309)) would be:

```
curl --request POST --header "Private-Token: askljdhakjdlsa" \
"http://10.10.10.10/api/v4/projects/9/merge_requests/67/notes?body=Comment%20test"

```