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

I did try $request->content_length(0); but then got "Not Found". Thing is there is no content. From research I saw something about a header "Transfer-Encoding: chunked" but I can't seem to set that.

Replies are listed 'Best First'.
Re^3: POST request problem
by Corion (Patriarch) on Jun 03, 2016 at 13:41 UTC

    Have you looked at what exactly you are sending now? I would suspect that whatever "not found" error you're getting now is the next step.

    Personally, I don't know how to make LWP::UserAgent send content in a "chunked" encoding. Maybe consider first simply printing directly all the headers and body yourself if you want to follow up that avenue.

      I know this particular URL will return "Not Found" if there is something wrong with the request (I have tried so many options now). When you say print the headers and body myself do you mean not to use HTTP::Request to create the request?

        Yes - getting anything that triggers a successful request is the most important thing. After that, you can try to coax HTTP::Request to produce the appropriate headers etc.

        From a quick Google search, it seems that you enable chunked transfers globally in HTTP::Request::Common via

        $HTTP::Request::Common::DYNAMIC_FILE_UPLOAD = 1;