I've been making curl requests to a long URL and saved the URL in a file named "url.txt". I then query that URL using the following command...
http://curl.haxx.se/docs/manpage.html#-K
curl -K ../url.txt
The url.txt
file in this case contains the data which is in the following format...
url = "http://mycustomurl.com/index.json?param1=hello,param2=world...
The url gets quite long. I also wanted to pass headers with that file, which I can pass using -H
flag as well. However, when using these two flags together, they do not seem to work as far as I can tell. Therefore, I'm trying to modify my url.txt
file to take the following format, and just use the first curl
statement.
header = "Accept: application/json"
url = "http://mycustomurl.com/index.json?param1=hello,param2=world...
The query still functions and returns the body of the page, but the header is not being properly passed to the server. I've checked my server logs to confirm. Is anyone able to shed any light on what I may be doing wrong in this instance? Any help would be greatly appreciated.
Thank you.