Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.