PHWinfo banniere

ACCUEIL ANNUAIRE ARTICLES COMPARATIF HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Go Back   PHWinfo > Forum Web Design > Web Design > comp.inf.authoring.html > httrp server responds 400 to seemingly-legal GET request
Register FAQ Members List Search Today's Posts Mark Forums Read
httrp server responds 400 to seemingly-legal GET request

Reply
 
Thread Tools
Old 07/04/09, 08:47   #1
pete
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default httrp server responds 400 to seemingly-legal GET request

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
Old 07/04/09, 10:32   #2
John Dunlop
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: httrp server responds 400 to seemingly-legal GET request

pete:

> 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.

> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 23:07.


Powered by vBulletin® ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
PHWinfo is a website Education Without Frontiers
Ad Management by RedTyger
All rights reserved
Page generated in 0.08624 seconds with 8 queries