Hello Matthias,

sorry for the very late reply. This has been fixed in the 2.0 branch on
12/29/2008. I wonder why it has not been fixed in the 1.1 branch as well.
I'll discuss this point with Jérôme.

Best regards,
Thierry Boileau


Hello,
>
> I have an issue when using the HTTP Client to send requests to a (full
> custom) HTTP server. I use roughly the following code to generate the
> request:
>
> client = new Client(Protocol.HTTP);
> request = new Request(Method.POST, "http://example.com:5000/";);
> someForm = new Form();
> /* add some stuff to the form ... */
> request.setEntity(someForm.getWebRepresentation(CharacterSet.ISO_8859_1));
> response = client.handle(request);
> /* ... */
>
> Using Restlet 1.1.10, this will send the following request to the server
> (seen through Wireshark):
>
> POST http://example.com:5000/ HTTP/1.1
> Host: example.com:5000
> User-Agent: Noelios-Restlet-Engine/1.1.10
> Accept: */*
> Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
> Content-Length: 40
> Connection: close
>
> nickname=*foo*&detail=2&connectlist=json
>
> I'm running into trouble because of the request (first) line, which
> contains the full host/port/path combo instead of just the absolute path.
> The server I'm talking to (which is not under my control) does not like to
> see the host duplicated there.
>
> If I understand the relevane section from RFC2616 correctly, the server
> should be able to deal with that request, but Restlet should not have
> generated it that way in the first place:
>
> > http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2
>
> <quote>
> To allow for transition to absoluteURIs in all requests in future versions
> of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests,
> even though HTTP/1.1 clients will only generate them in requests to proxies.
> </quote>
>
> Any thoughts on this?
>
> -Matthias
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2637045
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2649128

Reply via email to