I am trying to download a json file from a REST webpage in C++ with libcurl. The following code works if I go to the webpage but it doesnt download if I try to access the js
I think this has to do with the configuration on the HTTP server. First, you should be sending some type of indication of what type you're expecting, for example, adding an Accept header like this:
Accept: application/json
If you don't specify what you're expecting, the server may return the default HTML in the response header Content-Type, and that's what curl says to you.