HighDots Forums  

httrp server responds 400 to seemingly-legal GET request

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss httrp server responds 400 to seemingly-legal GET request in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pete
 
Posts: n/a

Default httrp server responds 400 to seemingly-legal GET request - 07-04-2009 , 02:47 AM






Hi everyone --

I can't figure out what I'm doing wrong.

I send a GET request and the server comes back with
400, Bad Request, which rfc2616 10.4.1 says must be
(as I infer) a syntax error in request.

Can someone tell me what the syntax error is? Or what
else I might've done wrong?


The GET request I send: "GET index.html HTTP/1.0\n\n"

That GET request in hex, as seen/captured by Wireshark:

0000 00 24 b2 1a e5 94 00 19 21 e9 88 2d 08 00 45 00
0010 00 41 f7 f6 40 00 80 06 96 b5 c0 a8 02 02 40 5c
0020 69 04 06 f2 00 50 8d 3f 03 3f e7 d4 74 84 50 18
0030 ff ff 68 42 00 00 47 45 54 20 69 6e 64 65 78 2e
0040 68 74 6d 6c 20 48 54 54 50 2f 31 2e 30 0a 0a

The ascii GET request as interpreted by Wireshark:

0000 .$...... !..-..E.
0010 .A..@... ......@\
0020 i....P.? .?..t.P.
0030 ..hB..GE T index.
0040 html HTT P/1.0..


The response, as Wireshark saw and captured it:

Expert Info (Chat/Sequence): HTTP/1.1 400 Bad Request\r\n
HTTP/1.1 400 Bad Request\\r\\n

(I've also have tried "GET index.html HTTP/1.0\r\n\r\n"
but the result is the same)

What in the world am I doing wrong?

Thanks!

-- p

Reply With Quote
  #2  
Old   
John Dunlop
 
Posts: n/a

Default Re: httrp server responds 400 to seemingly-legal GET request - 07-04-2009 , 04:32 AM






pete:

Quote:
I send a GET request and the server comes back with 400, Bad Request,
which rfc2616 10.4.1 says must be (as I infer) a syntax error in
request.
Aye.

Quote:
The GET request I send: "GET index.html HTTP/1.0\n\n"
There are two syntax errors:

1. The Request-URI can't be a relative-path reference (how would you
resolve it?). Use an absolute path-reference, e.g., </foo> (note the
initial slash).

2. Request-Lines must end in CRLF - probably \r\n in your notation.

By the way, "indexes" are rarely indexes and ".html" is generally
pernicious. (Sorry, close as I could get to obHTML!)

--
John

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.