[racket] HTTP request problem

From: Danny Yoo (dyoo at hashcollision.org)
Date: Fri Oct 5 10:47:47 EDT 2012

> I'm trying to write a simple HTTP client, but I haven't been able to figure out why I get a "malformed request" exception from the server. I have tried to modify the request and verified that it conforms to the web-server/http request-struct. Server throws this exception after having processed the request and having sent the response:


On the client side of things, can you use the functions provided in net/url?

    http://docs.racket-lang.org/net/url.html

get-pure-port and post-pure-port, in particular, may be applicable here.




The request structure that you were working with in the client code
is, to my knowledge, intended for use by the server side, not the
client side. Printing it to the port doesn't write it in the format
expected by the HTTP protocol.


Posted on the users mailing list.