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

http_persist_req( 'GET') method



   [cid:image001.gif@01D16452.87082990]

   All,

     Can someone provide a working example (rpg) that show how to retrieve
   data returned by using the http_persist_req( 'GET') method?  I have
   code that works but now sure how to parse the json it returns.  I can
   tell by the logs that it works.  I just can't determine how to get the
   json data returned back into a variable so I can evaluate it.


   Any help appreciated.



   Example of call:


      Pointer = http_persist_open( URL );

      if (pointer = *null);

          RETURN;

      endif;


     monitor;

            http_persist_req( 'GET'

                              : pointer

                              : url

                              : 0

                              : *null

                              : *null

                              : 0

                              : peFD

                              : %paddr(mysaveproc));

     on-error;

       rc=rc;

     endmon;


   http_persist_close( Pointer );


   p mysaveproc      b

   d                 pi            10i

   d fd                            10i 0 value

   d data                            *   value

   d length                        10i 0 value


        return length;

   p mysaveproc      e





   Log

   SetError() #0:

   [

     {

       "id": "5397a88f-5071-45c4-80cb-a5a7018155e7",

       "keyColumn": "0000041",

       "value":
   "\"[\\\"41\\\",\\\"0\\\",\\\"0\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"0\\\"
   ,\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"TARRANTDREW\\\"]\"",

       "url": null

     }

   ]

   http_close(): entered

   HTTPAPI Ver 1.29 released 2015-02-23

   NTLM Ver 1.4.0 released 2014-12-22

   OS/400 Ver V7R1M0


   http_setauth(): entered





   Drew White

   Programmer Analyst

   903-885-1283 x4207

   800-621-8030 x4207

   dwhite@xxxxxxxxxxxxxxxxxxx


   Email FE logo2



   Confidentiality Statement: This electronic mail transmission is
   confidential, may be privileged and should be read or retained only by
   the intended recipient. If you have received this transmission in
   error, please notify the sender immediately and delete it from your
   system.

GIF image

JPEG image

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------