[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] How do I do the actual POST with YAJL?



Hello Georgeann,

Yes.  The "xml" in the subprocedure name http_url_post_xml has to do with what happens when the results are received.  It has nothing to do with what is sent.

http_url_post_xml is equivalent to calling http_url_post_raw to receive into a char variable, followed by http_parse_xml_string to interpret the result.  Notice that it is ONLY the result (not the data being sent) that is interpreted as XML.  So if you are sending JSON but planning to _receive_ XML, then calling http_url_post_xml makes perfect sense.

If you plan to _receive_ JSON -- which would be the more common scenario that you'd be both sending and receiving JSON -- then you would not call the "xml" variant of the routine.  Instead, you'd call http_url_post_raw (if you want to stick with the old-school legacy API, for example because you're still running V5R4 or older) and then interpret the JSON as a separate step.

If you're running a recent version of IBM i... especially V7R2 or newer -- I would strongly recommend that you stop using the legacy routines in HTTPAPI.  Instead, using DATA-GEN or SQL to build the JSON document, call http_string() to send it, and interpret the response using DATA-INTO or SQL. 

Good Luck,

-SK


On 10/12/2020 1:07 PM, Georgeann Rybak wrote:

Can I use the http_url_post_xml  command if I need to send a json file? 

 

Georgeann Rybak

 


Software Engineer, Information Technology

The American Registry Of Radiologic Technologists®

 


Direct Phone & Fax651.681.3133 | Main Phone651.687.0048

1255 Northland Drive, St. Paul, MN 55120

arrt.org

 


 

From: Georgeann Rybak
Sent: Friday, October 09, 2020 11:54 AM
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [Ftpapi] How do I do the actual POST with YAJL?

 

That makes perfect sense – l already have the LIBHTTP library

 

Thanks a lot,

 

Georgeann Rybak

 


Software Engineer, Information Technology

The American Registry Of Radiologic Technologists®

 


Direct Phone & Fax651.681.3133 | Main Phone651.687.0048

1255 Northland Drive, St. Paul, MN 55120

arrt.org

 


 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Jon Paris
Sent: Friday, October 09, 2020 11:49 AM
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Ftpapi] How do I do the actual POST with YAJL?

 

Have you already established;ished communications with the web site using HTTPAPI?

 

There are examples of how to submit form data etc. in the LIBHTTP library.  If you are using a web service (REST or SOAP) the process is a little different and there are examples of that too.

 

 

 

 

On Oct 9, 2020, at 12:37 PM, Georgeann Rybak <georgeann.rybak@xxxxxxxx> wrote:

 

I am trying to update data on a website using Json with RPG.

 

I am using YAJL and have been using the ‘Working with JSON in RPG’ as a guide.  I have gotten as far as the JSON_Finish subroutine and I do get a JSON file created.

 

What I am missing is how do I then use that JSON file to actually update records?  I am not seeing how that happens.

 

Thanks for any advice,

 

Georgeann Rybak

 


SOFTWARE ENGINEER, INFORMATION TECHNOLOGY

THE AMERICAN REGISTRY OF RADIOLOGIC TECHNOLOGISTS®

 


DIRECT PHONE & FAX 651.681.3133 | MAIN PHONE 651.687.0048

1255 NORTHLAND DRIVE, ST. PAUL, MN 55120

 


 

 

Georgeann Rybak

 


SOFTWARE ENGINEER, INFORMATION TECHNOLOGY

THE AMERICAN REGISTRY OF RADIOLOGIC TECHNOLOGISTS®

 


DIRECT PHONE & FAX 651.681.3133 | MAIN PHONE 651.687.0048

1255 NORTHLAND DRIVE, ST. PAUL, MN 55120

 


 

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

 


-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi