http_post using REST

Use this board for starting discussions, asking questions, and giving advice on RPG programming for the IBM i platform (and predecessors.)
HOLMRICK@GMAIL.COM
New User
Posts: 1
Joined: Wed Sep 21, 2016 7:51 pm
First Name: Rick
Last Name: Holm
Company Name: Manage, Inc
Phone: 2066829302
Address 1: 1818 Westlake Ave North
Address 2: Seattle
City: Seattle
State / Province: Washington
Zip / Postal Code: 98109
Country: United States
Contact:

http_post using REST

Post by HOLMRICK@GMAIL.COM »

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
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: http_post using REST

Post by Scott Klement »

You can get free (community) support for HTTPAPI from the HTTPAPI/FTPAPI mailing list, which you can subscribe to here:
http://scottklement.com/mailman/listinfo/ftpapi

You can get paid/commercial support from Profound Logic by purchasing a support contract. To get a quote e-mail sales@profoundlogic.com
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest