in reply to Re^5: 400 bad request curl post
in thread 400 bad request curl post

I respectfully disagree.

It prints out the "Content-type:" header, and and dumps out some html. So, if it's dropped into the right place, it certainly is a "CGI script". It may get the content via LWP, but that doesn't change anything. You can write a "cgi script" in /bin/sh. If it happens to get it's content with curl that doesn't suddenly make it not a CGI script.

CGI.pm has nothing to do with anything at all in this case.

Replies are listed 'Best First'.
Re^7: 400 bad request curl post
by 1nickt (Canon) on Dec 08, 2018 at 12:39 UTC

    Well, I suppose you may be right. I considered both the OP's history of throwing random snippets of code into his scripts, and also the fact that the request he is making is apparently to an API that expects and returns JSON, so I figured he was still in the debugging phase trying to get and print his JSON response. Didn't occur to me that his script intended to simply dump the request response to a browser.


    The way forward always starts with a minimal test.