in reply to POST request problem

Unless I'm missing something obvious, your POST request has no payload, unlike the sample you've been given, ie. you never call the content method of your request object to set the data. This may be all that is required.

Replies are listed 'Best First'.
Re^2: POST request problem
by bangor (Monk) on Jun 03, 2016 at 16:07 UTC
    Hi hippo, you may have missed last line of my original question - I tried giving it a content of an empty string but it did not generate the boundary in the header and body which is what I think is necessary. The example I was given comes from the Postman app - if you put a URL in and then choose "multipart/form-data" that is the request it generates. I am trying to duplicate that.

      Yes, somehow missed reading that, thanks.

      However, I would recommend giving it some actual content (not an empty string). Do the folks running the server not suggest what the POSTed content should be? There is little point to a POST request with no content.

        There is little point to a POST request with no content.

        I know, all the info is in the query string and to my mind this should be a simple GET request. There are a few layers between me and the people running the server which I have not been able to penetrate. I will try out giving it some content, and also Corion's suggestion. Thanks.

      Adding to what hippo said, from RFC 2616:

      The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.

      So, many webservers require that POST requests have actual content. However, it's up to whomever designed/implemented the handler pointed to by the URI to describe what that content should be.

      but it did not generate the boundary in the header and body which is what I think is necessary.

      Its highly unlikely it would be necessary (highly unlikely), but anything is possible (stupid servers exist)

      Server should only care about "content", the chunked/boundary stuff is just ways to deliver "content", only some kind of http test server would "require" that type of request