Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools HTTP Basics Introduction to HTTP Sending Data with a POST Request

Edgar Isai Salgado Cortez
Edgar Isai Salgado Cortez
4,048 Points

When I try to add the blank line between the header and the payload it just sends the response with 200, any idea why?

This is what i type in the consol and the output:

treehouse:~/workspace$ telnet httpbin.org 80
Trying 34.238.32.178...
Connected to httpbin.org.
Escape character is '^]'.
POST /post HTTP/1.1
Host: httpbin.org
Content-Lenght: 32

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Thu, 25 Apr 2019 02:27:17 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 267
Connection: keep-alive

{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Content-Lenght": "32",
"Content-Length": "0",
"Host": "httpbin.org"
},
"json": null,
"origin": "52.72.224.187, 52.72.224.187",
"url": "https://httpbin.org/post"
}

1 Answer

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Your header says Content-Lenght instead of Content-Length. If I fix that I'm able to get past the blank line and continue the request.

Edgar Isai Salgado Cortez
Edgar Isai Salgado Cortez
4,048 Points

Thank you!, that solved my problem, I will be more careful with typos.