1

I cannot seem to get BITSADMIN to perform an HTTP(S) JSON request.

bitsadmin /create Job
bitsadmin /setcustomheaders Job "Content-Type:application/json" "Accept:application/json"
bitsadmin /addfile Job "https://jsonplaceholder.typicode.com/posts" a.json

Produces

Unable to add file - 0x80070057
The parameter is incorrect.

I know next to nothing about this stuff, and none of the stuff I manage to google online seems to touch what I am trying. With cURL I can just say:

curl "https://jsonplaceholder.typicode.com/posts" -o a.json

I am trying to avoid requiring my users to install cURL on their Windows boxes. And a number of my users are still sporting Windows 7, so the PowerShell Invoke-WebRequest applet doesn’t exist either...

Am I doing something wrong? (Like, am I using the wrong tool? Or am I just missing something that should be obvious?)

1 Answer 1

2

I haven't used bitadmin ever before, but tried my luck with google.

This here is 14 years old: Old topic but gave me a hint

This one is old, too, but confirmed my suspicion: Confirming my suspicion

It looks like your "a.json" is the problem, and you need the full file-path instead, as the person in the 2nd link said. If you use a newer version of bitadmin and by your release bitadmin is capable of using relative file path, then my bad.

1
  • Wow. I was so focused on the URL I never thought it could be that. Nice! Now I have to figure out why I am not getting data from my target URL... Thanks!
    – Dúthomhas
    Apr 6, 2019 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .