Blockland Forums > Modification Help

Revenge of the TCP object [Solved]

Pages: << < (2/16) > >>

Kalphiter:

I am not an arrow/circumflex.

Slicks555:


--- Quote from: Kalphiter on May 05, 2012, 06:46:10 PM ---I am not an arrow/circumflex.

--- End quote ---
Okay, you're a caret.

Ipquarx:

%Request = "GET" SPC %File SPC "HTTP/1.0\nHost:" SPC %Server @ "\r\n";


--- Quote from: Kalphiter on May 05, 2012, 06:33:11 PM ---\r\n for newlines in the HTTP protocol headers
--- End quote ---
Would it still work if someone typo'd and wrote \n\n instead? And what about the HTTP/1.0? Is there any difference if you put HTTP/1.1 over 1.0?

Slicks555:


--- Quote from: Ipquarx on May 05, 2012, 07:14:55 PM ---%Request = "GET" SPC %File SPC "HTTP/1.0\nHost:" SPC %Server @ "\r\n";
Would it still work if someone typo'd and wrote \n\n instead? And what about the HTTP/1.0? Is there any difference if you put HTTP/1.1 over 1.0?

--- End quote ---
The server handles the HTTP version, I would use 1.1 just because that's what everything uses. But no, it doesn't really make a difference.

However, \r\n is required. It's how the webserver knows you've ended the line. You could do something like:

--- Code: ---%tcp.send("Host: www.");
%tcp.send(%domain);
%tcp.send(".com");
%tcp.send("\r\n");

--- End code ---
and it would still work, because the webserver knows \r\n is the end of the line, not the end of the transmission.

With that said, your request line:
%Request = "GET" SPC %File SPC "HTTP/1.0\nHost:" SPC %Server @ "\r\n";

needs to be:
%Request = "GET" SPC %File SPC "HTTP/1.0\r\nHost:" SPC %Server @ "\r\n";

Port:


--- Quote from: Ipquarx on May 05, 2012, 07:14:55 PM ---%Request = "GET" SPC %File SPC "HTTP/1.0\nHost:" SPC %Server @ "\r\n";

--- End quote ---

The highlighted parts won't work together. Request headers were introduced in HTTP/1.1.

Pages: << < (2/16) > >>

Go to full version