I'd like to read in a GPX file using makeWebRequest().
I started with the webRequest sample app and got that to work.
I've created a GPX file for testing, placed in in a Google Drive, set sharing to anyone with the link, and verified with a browser that the link works to read the file.
I'm now trying to read that file using makeWebRequest() and I get a -400 error indicating "Response body data is invalid for the request type".
I've tried many combinations and variations in the options to the makeWebRequest() call. So far they all have returned -400.
Can someone provide a solution..... what combination of parameters to the makeWebRequest() call will let me read the file ?
Here's the code that makes the call:
//! Make the web request
private function makeRequest() as Void
{
_notify.invoke("Executing\nRequest");
var options =
{ :method => Communications.HTTP_REQUEST_METHOD_GET,
//:headers => { "Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON }, // URL_ENCODED },
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON //TEXT_PLAIN // was TYPE_JSON
};
var reqStr = "">drive.google.com/.../view
System.println("request string = " + reqStr );
Communications.makeWebRequest( reqStr, {}, options, method(:onReceive) );
}