# Missing carriage return character '\\r' in request body causes 400 Bad Request

**URL:** <https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583>\
**Category:** Help Hub\
**Tags:** request\
**Created:** [February 19, 2021, 4:09pm UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583 "2021-02-19T16:09:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tafadzwagonera](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tafadzwagonera](https://community.postman.com/u/tafadzwagonera)\
**Post date:** [February 19, 2021, 4:09pm UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/1 "2021-02-19T16:09:56Z")

</div>

I’ve been struggling with this for days and feel like I’m losing my mind. I’ve 2 identical requests 1 returns a `200 OK` and the other returns a `400 Bad Request`. I sniffed the requests in Postman console and discovered that the `200` request has `Content-Length` 1982 while the `400` request has `Content-Length` 2026.

 ![Screenshot 2021-02-19 17:46:36](https://us1.discourse-cdn.com/getpostman/original/2X/5/588af3e4e7e435bcbaac02d478419794e734da95.png)

I exported the collections associated with each request as JSON and figured that the `200` request body had `\r\n` as a line terminator while the `400` request body has `\n` as a terminator line. I presume this accounted for the difference between the 2 `Content-Length`s above.

 ![Screenshot 2021-02-19 17:50:25](https://us1.discourse-cdn.com/getpostman/original/3X/7/a/7a1cd375de6fe316d86d4fee96ad7394a25e50af.png)

I replaced each `\n` with `\r\n` in the `400` JSON file and imported it back in Postman and ran the request again only to get a 200 which is great but doesn’t explain why lack of `\r` would cause a `400 Bad Request`.

The request is MTOM SOAP [Example MTOM SOAP Request for the CheckInAAF Operation · GitHub](https://gist.github.com/alexfx/e90b9518a5fb04c1dc82a6bbc08d329a)

I presume the request wasn’t “interpreted” into the correct format because of a lack of `\r`

---

<div class="post-metadata">

**Author:** ![pranavdavar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/pranavdavar/32/9152_2.png) [@pranavdavar](https://community.postman.com/u/pranavdavar)\
**Post date:** [February 21, 2021, 10:07am UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/2 "2021-02-21T10:07:10Z")

</div>

@tafadzwagonera, on checking your sample payload and your query. Basically \n, \r is used to denote a new line, and it depends on the interpreter how it interprets. The reason you got the error 400(Bad request) depends on how your target service is configured. I just found one query on stackoverflow which contains useful information regarding these new line characters.

> <https://stackoverflow.com/questions/1761051/difference-between-n-and-r/1761086#1761086>

Hope this helps.

---

<div class="post-metadata">

**Author:** ![tafadzwagonera](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tafadzwagonera](https://community.postman.com/u/tafadzwagonera)\
**Post date:** [February 21, 2021, 10:10am UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/3 "2021-02-21T10:10:54Z")

</div>

@pranavdavar I’ve just read the linked SO answer. There are all sorts of useful explanations there. This has been helpful.

---

<div class="post-metadata">

**Author:** ![webman47](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@webman47](https://community.postman.com/u/webman47)\
**Post date:** [March 27, 2023, 4:11am UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/4 "2023-03-27T04:11:12Z")

</div>

This is an old message, and I don’t see any other postings about this specific error.  
Is it that the issue has been fixed and that Postman user can specify a CR or CR LF ?  
Or systems that weren’t flexible enough to handle the differences (due to OS?) are now obsolete?

---

<div class="post-metadata">

**Author:** ![tafadzwagonera](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tafadzwagonera](https://community.postman.com/u/tafadzwagonera)\
**Post date:** [March 27, 2023, 4:50am UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/5 "2023-03-27T04:50:58Z")

</div>

> Is it that the issue has been fixed and that Postman user can specify a CR or CR LF?

Yes and yes.

> Or systems that weren’t flexible enough to handle the differences (due to OS?)…

I can’t say for sure but I’d bet that’s very likely.

The context around the problem was that I was programmatically marshalling a SOAP request in a POSIX environment for a third party web service probably running in a Win environment.

---

<div class="post-metadata">

**Author:** ![webman47](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@webman47](https://community.postman.com/u/webman47)\
**Post date:** [March 28, 2023, 1:09am UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/6 "2023-03-28T01:09:47Z")

</div>

How are you able to specify a CR or CR LF in the postman body ? Hopefully, it is something simple as configuration/setting or adding a /r etc ?

---

<div class="post-metadata">

**Author:** ![tafadzwagonera](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tafadzwagonera](https://community.postman.com/u/tafadzwagonera)\
**Post date:** [March 28, 2023, 5:30am UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/7 "2023-03-28T05:30:16Z")

</div>

> Hopefully, it is something simple as configuration/setting or adding a /r etc ?

I don’t know if there’s a configuration setting for line breaks i.e. CR and CRLF in Postman. I couldn’t find it at the time. The process is simple enough. I’d [export](https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#:~:text=line%20collection%20runner.-,Exporting%20collections,your%20newly%20generated%20JSON%20file.) a collection as `json`. Open the collection in a text editor like Sublime then modify line breaks (i.e. `/r/n` into `/r`), save and import back into Postman.

---

<div class="post-metadata">

**Author:** ![webman47](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@webman47](https://community.postman.com/u/webman47)\
**Post date:** [March 28, 2023, 10:58pm UTC](https://community.postman.com/t/missing-carriage-return-character-r-in-request-body-causes-400-bad-request/20583/8 "2023-03-28T22:58:10Z")

</div>

I understand. Thank you for responding.
