First, make sure that your request line is terminated by CR LF (in backslash
mode on a string, this would be \r\n).
Second, you are using the "Simple" format for the request (from HTTP/0.9)
which may not be supported by all new servers. You may want to use the version
1.0 format which looks like this:
GET HTTP/1.0\r\n
Headerline 1\r\n
Headerline 2\r\n
Headerline n\r\n
\r\n
The empty line at the end of the request is important. So, to get /subdir1/file.ext,
you could send (using the least amount of information):
GET /subdir1/file.ext HTTP/1.0\r\n\r\n
Yes, there are two sets of \r\n in this request.
Note that the reply of a 1.0 request begins with one or more header lines,
followed by an empty line, followed by the data. Header lines are terminated
by
\r\n, so you can search for \r\n\r\n to find the beginning of the data.
There is more to HTTP than this; the Internet Toolkit from NI contains VIs
that retrieve documents over HTTP (supporting user authentication, redirection,
virtual hosts, etc.)
- Stepan Riha
"Christopher G. Atwood" wrote:
>...When I try connecting to an HTTP port (80), the connection is
>established OK, but when I try different variations of requests, all I
>get back is the string>>HTTP/1.0 400 Bad Request