in reply to Re: POST request problem
in thread POST request problem

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.

Replies are listed 'Best First'.
Re^3: POST request problem
by hippo (Archbishop) on Jun 03, 2016 at 16:14 UTC

    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.

Re^3: POST request problem
by RonW (Parson) on Jun 03, 2016 at 22:04 UTC

    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.

Re^3: POST request problem
by Anonymous Monk on Jun 04, 2016 at 00:11 UTC

    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