Message 1 of 11
XMLHttpRequest NETWORK_ERR
Not applicable
10-07-2016
09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a library script that makes an XMLHttpRequest to a REST API. The script works fine if I set the XMLHttpRequest URL to http://myapi.foo.com, but when I try to change the request to https://myapi.foo.com (notice the s in https), the script fails with a NETWORK_ERR and no additional error information. I am able to execute the same request from Chrome developer tools and Firefox developer tools using the https URL without issue. Has anyone else encountered this issue? Are there any other ways to make an HTTPS request in PLM Scripting?
Failing Script:
var APIURL = "https://myapi.foo.com";
var xhr = new XMLHttpRequest();
xhr.open('PUT',APIURL);
xhr.send(); // fails here
var response = xhr.responseText;Successful Script:
var APIURL = "http://myapi.foo.com";
var xhr = new XMLHttpRequest();
xhr.open('PUT',APIURL);
xhr.send();
var response = xhr.responseText;Thanks!
