# Correct format for HTTP/1.1 API replies

**URL:** <https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452>\
**Category:** Help Hub\
**Tags:** request, servererror\
**Created:** [June 22, 2022, 8:36am UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452 "2022-06-22T08:36:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyquant2020](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@andyquant2020](https://community.postman.com/u/andyquant2020)\
**Post date:** [June 22, 2022, 8:36am UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452/1 "2022-06-22T08:36:20Z")

</div>

I am creating an embedded web API interface in a gadget that I am building.  
I’m able to set the device up as a AP, create a Socket and listen on Port 80.  
It receives an API GET request from Postman.

This is what I receive…

```auto
GET /HelloWorl HTTP/1.1                        
User-Agent: PostmanRuntime/7.29.0                                               
Accept: */*                                                                     
Postman-Token: 72cac2d1-8da1-4274-80b1-d53275016f67                             
Host: 192.168.230.3                                                             
Accept-Encoding: gzip, deflate, br                                              
Connection: keep-alive            

```

This is what I am sending back in response to the GET…

```auto
HTTP/1.1 200 
Connection: OK keep-alive 
Postman-Token: cd3b8bf5-7d75-433a-88b2-4908b418a267
Content-Type: application/json
{"id": 10,"name": "shirt","color": "red","price": "$23"}

```

This what I observe on Wireshark…

![image](https://us1.discourse-cdn.com/getpostman/original/2X/a/a5670d6587ba9043a59413d372a0435a55a64d2b.png)

This is the error message I get in Postman…

> Parse Error: There seems to be an invalid character in response header key or value

Can someone identify what I am doing wrong here?

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [June 22, 2022, 10:29am UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452/2 "2022-06-22T10:29:06Z")

</div>

Hi @andyquant2020

Could you screenshot your GET request + headers and your Response + headers in Postman?  
Might help to visualise what you are doing.

---

<div class="post-metadata">

**Author:** ![andyquant2020](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@andyquant2020](https://community.postman.com/u/andyquant2020)\
**Post date:** [June 22, 2022, 10:40am UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452/3 "2022-06-22T10:40:42Z")

</div>

GET request

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/9/9fb8d155bc6124b550dc45b1f708beaf271b34eb.png)

Response

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/5/52295f5c6c927c2b662e864cbeb3d0272851cb7a.png)

---

<div class="post-metadata">

**Author:** ![andyquant2020](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@andyquant2020](https://community.postman.com/u/andyquant2020)\
**Post date:** [June 22, 2022, 11:05am UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452/4 "2022-06-22T11:05:43Z")

</div>

Does the response Postman-Token need to match the Postman-Token supplied in the GET request?

---

<div class="post-metadata">

**Author:** ![andyquant2020](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@andyquant2020](https://community.postman.com/u/andyquant2020)\
**Post date:** [June 22, 2022, 2:56pm UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452/5 "2022-06-22T14:56:09Z")

</div>

I have solved the issue I was having myself.  
Including the content length appears to have fix my problem

> HTTP/1.1 200 OK  
> Content-Type: application/json  
> Content-Length: 44  
> {“type”:“pressure”,“value”:300,“unit”:“hPa”}

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [August 23, 2023, 3:05pm UTC](https://community.postman.com/t/correct-format-for-http-1-1-api-replies/36452/6 "2023-08-23T15:05:39Z")

</div>

Closed on August 23, 2023, 3:05pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
