http_post using REST
Posted: Wed Sep 21, 2016 8:15 pm
I need to post an xml file to a Web Service using REST and I need to supply a user id and password. Using HTTPAPI, I can get my XML edited by the Web Service server but then I get back a "HTTP/1.1 422 Unprocessable Entity" in the debug log.
I would like to use one of the http_post apis, but I have not been able to find an example that shows supplying the user id and password and using REST. So I tried using HTTP_SetAuth(HTTP_AUTH_BASIC:UserId:Pass) and then followed by http_post_stmf api with my xml file. After trying to post the file, I get HTTP/1.1 415 Unsupported Media Type. It seems like I now need to supply the content type parameter to tell the server I am sending xml or maybe I should be using http_post_xml.
Thanks for any guidance.
Rick Holm
I would like to use one of the http_post apis, but I have not been able to find an example that shows supplying the user id and password and using REST. So I tried using HTTP_SetAuth(HTTP_AUTH_BASIC:UserId:Pass) and then followed by http_post_stmf api with my xml file. After trying to post the file, I get HTTP/1.1 415 Unsupported Media Type. It seems like I now need to supply the content type parameter to tell the server I am sending xml or maybe I should be using http_post_xml.
Thanks for any guidance.
Rick Holm