On the system.net.httpDelete
function, it's missing the keyword argument throwOnError=True
. This is on other methods such as httpPost
, but not on delete.
This means I can't get any meaningful information back from the response when the status code of the delete response isn't in the 200 range.
What version of Ignition are you using?
Use system.net.httpClient instead. It’s the indended replacement for the other HTTP scripting functions in 8.x.
The status is available in the response objects from this call.
How can I include post data (not url parameters) and headers with httpClient?
Look under the "JythonHttpClient Methods" section of the docs: system.net.httpClient - Ignition User Manual 8.1 - Ignition Documentation
It's the data
and headers
parameters.
Thanks, that worked.
Though quick question. I keep getting an error that the URL contains an invalid character. In this case, |
. The URL in question: https://dev-redacted.us.auth0.com/api/v2/users/auth0|6468f7bbf0c4adceed59f78c/roles
Both firefox and curl recognize this as a valid URL without warning. But Ignition throws an error unless I encode that character to '%7C'.
Is that intended behavior?
Hmm, what's the exact error? Java tends to do strict URI syntax checking, while other software will often just treat it as a String and pass it through.
edit: yeah, so "|" isn't a legal character in a URI unless it's encoded, and we aren't doing any URL encoding for you.