3

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?

Sven
  • 97,248
  • 13
  • 177
  • 225
Matt Cashatt
  • 235
  • 3
  • 7

1 Answers1

5

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
squillman
  • 37,618
  • 10
  • 90
  • 145