4

I am trying to use cURL in the Command Prompt, but I dont understand where I have problems. I have been told that I need to configure a proxy tothe Command Prompt so that it can access the sites I am calling on.
This is what I want to run: curl -glob "api.fda.gov/drug/event.json?&search=receivedate:[20040101+TO+20150101]&limit=1"
I have cURL installed, but always face errors because it is not connecting. Is there a simple way to set up a proxy for/through the Command Prompt in Windows 7?

I also do not have admin rights, so I cannot change the system settings.

cbruno
  • 71
  • 1
  • 1
  • 8
  • possible duplicate of [how to set proxy for command prompt?](http://stackoverflow.com/questions/22059670/how-to-set-proxy-for-command-prompt) – Ken White Jul 09 '14 at 15:26
  • @KenWhite I had seen that before. I do not have admin rights, so I cannot change the system settings. Is there another way to add a proxy? – cbruno Jul 09 '14 at 15:32
  • 2
    Type the SET commands from the command prompt before typing your curl command, as in `SET http_proxy=` and `SET https_proxy=` (or better yet use a batch file to set them and then run curl). – Ken White Jul 09 '14 at 15:38

2 Answers2

3

You can set your proxy using a set command in windows:

set http_proxy=http://<yourproxyaddress>:<port>

Then you can connect your curl requests to external sites.

Koby Douek
  • 16,156
  • 19
  • 74
  • 103
2

Some proxies require specific authentication headers to be set, so be aware of those as well. In my case, it's --proxy-ntlm in the example below:

curl -x webproxy.net:8080 -U usernaname:password http://google.com --proxy-ntlm

But there're other options:

--proxy-digest and --proxy-negotiate

Lastly, cURL has a super friendly doc page, so be sure to check it out.

Ostati
  • 4,623
  • 3
  • 44
  • 48