-1

I am looking at an API that I would like to use and am having a hard time figuring out how to use it. This API needs me to give URL requests to a website and it will respond with JSON data. An example request that they give is:

 curl -i -H "X-Accept-Datetime-Format: UNIX" "https://api-fxpractice.oanda.com/v1/candles?instrument=EUR_USD&start=137849394&count=1"

I can not figure out how to make a request like this in a php script. I have looked at many websites but I still don't understand what the -i and the -H are used for. Furthermore I am having trouble finding a website that will explain how the data :"X-Accept-Datetime-Format: UNIX" is supposed to be sent to a website through a URL request in php. All help in finding a website that will better explain what all of this means and how I can create a php script to run this will be very helpful. Thank you very much for your help!

Isaac Singer
  • 89
  • 2
  • 5

1 Answers1

0

Use curl and set this line as a header . Curl is inbuilt in php.