Using Windows Server, how to schedule an hourly task that will call a URL WITH an authorization header

authorizationscheduled-taskwindows-server-2008

I need to schedule a task that will call a given url hourly. The URL doesn't return anything so it is fairly simple HOWEVER this URL requires an authorization header:

Authorization: Basic {SOME AUTH CODE}

How do I append this header to the request with Windows Task Scheduler?

Best Answer

Use cURL in a script and set it to be run via scheduled task.

You don't have to set the authorization header manually, you can just use the --user argument

curl --user user:pass http://www.example.com

If you really want to add the header manually use the -H / --header switch. More on that here.

curl -H "Authorization: [auth string]" http://www.example.com