I can get curl to work fine from my development machine, but for various reasons I need to explore making wget work. So far I haven't had luck. I get either a "Bad Request" or "Unsupported Media Type" error. So I need to know a) if wget can even be used successfully to submit a JSON file of tickets to create and b) some examples of the wget statement that will do it. Thanks in advance. --Joe
Community moderators have prevented the ability to post new answers.
Thanks for the response Peter. I should have included additional detail.
When I was getting the unsupported media type it was without the --header option. So then I did the same thing you suggested below, and added the --header=Content-Type:application/json to my wget call. That's when the error switched from Unsupported Media Type to BAD REQUEST errors. See below:
Notes:
$ wget --user=username --password=password --post-file=testfile.json --header=Content-Type:application/json "https://host-address:port/rest/api/2/issue/bulk"
HTTP request sent, awaiting response... 400 Bad Request
2017-02-03 10:27:32 ERROR 400: Bad Request.
Hi,
Maybe you need to send additional headers (e.g for the unsupported media type - the application/json Content-Type header). Headers are send with the --header wget option (e.g.
wget --header=Content-Type:application/json "http://www.example.com:9000/json"
Regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.