Here's the key, replace "/file.txt" with "http://myhost.com/file.txt".
Also, I put everything into a byte array when sending, this resolves some of
the problems of parameter passing.

Bryan Keller wrote:

> I've been struggling with this problem for a few days now...
>
> When using the INetLibURLOpen() function on the Palm VII, I am able to
> go through the Palm.Net proxy and download a file off of my web server.
> My problem is that I want to see the HTTP header in the response and I
> also want to be able to do "POST" commands. INetLibURLOpen() doesn't
> seem to allow this.
>
> The docs say that INetLibURLOpen() is merely a convenience function that
> calls INetLibSockOpen(), INetLibSockConnect(),
> INetLibSockHTTPReqCreate(), and INetLibSockHTTPReqSend(). By calling
> these instead, I'd be able to set some parameters to get the HTTP header
> and to do POSTSs.
>
> When I replace my INetLibURLOpen() call with these function calls,
> though, I get a "Bad request" error send back from the Palm.Net proxy (I
> check it via INetLibSockHTTPAttrGet()), and my web server never gets the
> request.
>
> I have tried almost every possible combination of parameters and
> settings, to no avail. Why isn't the HTTP request being built properly??
> Am I setting the parameters incorrectly?
>
> -Bryan
>
> Here's the code (error checking, extraneous stuff removed):
>
> (this works)
>
> Handle ref;
>
> INetLibURLOpen(mLibRefNum, mINet, (BytePtr)"http://myhost.com/file.txt",
> NULL, &ref, -1, 0);
>
> (this doesn't)
>
> Handle ref;
>
> INetLibSockOpen(mLibRefNum, mINet, inetSchemeHTTP, &ref);
>
> INetLibSockConnect(mLibRefNum, ref, (BytePtr)"myhost.com", 0, -1);
>
> INetLibSockHTTPReqCreate(mLibRefNum, ref, (BytePtr)"GET",
> (BytePtr)"/file.txt", NULL);
>
> INetLibSockHTTPReqSend(mLibRefNum, ref, NULL, 0, -1);

Reply via email to