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

[Ftpapi] Rif: Re: Data truncated while sending json with http_string



Hello Scott !!
Thank you very much.
It works!!!
I try also with
rc = http_req( 'POST'                                                    
             : url                                                      
             : ifsrcv                          
             : *omit                            
             : ifssnd                          
             : *omit                      
             : 'application/json' );    

Now i am going to try the json parser to read the return data.

Best regards Federico




Da:        "Scott Klement" <sk@xxxxxxxxxxxxxxxx>
Per:        ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Data:        13/08/2020 19:40
Oggetto:        Re: [Ftpapi] Data truncated while sending json with http_string




Hello Federico,

http_string() is limited to sending 100.000 characters.  http_stmf() would be a better choice.  You are passing the 'ifs' variable into the parameter that is used to receive the result.  it is the wrong parameter for the data to send.

The syntax of http_stmf is  http_stmf( METHOD : URL : IFS_TO_RECEIVE_INTO: IFS_TO_SEND : TYPE )

So you would likely want something like this:

rc = http_stmf( 'POST': url: receive_ifs: ifs: 'application/json');

Good Luck

On 8/13/2020 9:10 AM, federico.forsi@xxxxxxxxxxx wrote:
Hello,  following the example reported in the document Working with json in RPG,  i create a json data using yajl functions.
I send the data using the HTTPAPI  http_string and it works if the json data are small.

If i try to send the orders of an entire day the data are truncated ad i recive an error (see loghttp_string)

The code of the call to http_string function is :

begsr HTTP_Send;                                                      

                                                                     
                               
                                                                     
url = ''POST':url:request:'application/json');        

on-error;                                                            


The variable request is declared as :

  D request         s        1600000A  



I try also saving the json data as a ifs file (see orders.txt) and sending it with the function http_stmf but i recive an error (see loghttpstmf)


I would like to create the json data in a ifs's file and  send it to the API using POST method.

Here the code
callp http_stmf('POST':url:ifs);    


What is wrong in my procedure?


The OS is V7.R4 and the HTTPAPI is 1,41


Regards Federico          




I dati da lei conferiti sono trattati elettronicamente e manualmente dagli incaricati e comunicati a terzi per la gestione dell' attivita' economica e per l' invio di materiale pubblicitario; un eventuale rifiuto al trattamento non consente la sua corretta esecuzione. Ha diritto di accesso ai suoi dati ed altri diritti, come da art. 7 - D.Lgs.196/03.
L' informativa privacy, ai sensi e per gli effetti di cui all'art. 13 del D.lgs 196/03, e' consultabile all' indirizzo web
www.franzini.it/informativa.htm.

The informations provided will be processed manually and electronically by the data manager and will be disclosed to third parties for the management of economic and sending promotional materials; any refusal to treatment does not allow its proper implementation. You have access to these datas and other rights in accordance with art. 7 - D.Lgs.196/03. The privacy policy, in accordance with and for purposes of Art. 13 of Legislative Decree 196/03, is available at website
www.franzini.it/informativa.htm.

Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque, destinate esclusivamente alle persone o alla Società sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p. , che ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di informarci immediatamente per telefono allo 0522.929411 o inviando un messaggio all’indirizzo e-mail
mbox@xxxxxxxxxxx . Inoltre, il messaggio da Voi ricevuto è di natura non personale e le risposte al presente, potranno essere conosciute nell’organizzazione di appartenenza del mittente.

The information in this e-mail (which includes any files transmitted with it) is confidential and may also be legally privileged. It is intended for the addressee only. Access to this e-mail by anyone else is unauthorised. It is not to be relied upon by any person other than the addressee, except with our prior written approval. If no such approval is given, we will not accept any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting on such information. Unauthorised recipients are required to maintain confidentiality. If you have received this e-mail in error please notify us immediately, destroy any copies and delete it from your computer system. Any use, dissemination, forwarding, printing or copying of this e-mail is prohibited. Copyright in this e-mail and any document created by us will be and remain vested in us and will not be transferred to you. We assert the right to be identified as the author of and to object to any misuses of the contents of this e-mail or such documents.


--

Questo messaggio è stato analizzato con Libraesva ESG ed è risultato non infetto.

Segnala come spam.
Mettilo in blacklist. --
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
https://urlsand.esvalabs.com/?u=http%3A%2F%2Fscottklement.com%2Fmailman%2Flistinfo%2Fftpapi&e=d180086f&h=480b7513&f=y&p=y






I dati da lei conferiti sono trattati elettronicamente e manualmente dagli incaricati e comunicati a terzi per la gestione dell' attivita' economica e per l' invio di materiale pubblicitario; un eventuale rifiuto al trattamento non consente la sua corretta esecuzione. Ha diritto di accesso ai suoi dati ed altri diritti, come da art. 7 - D.Lgs.196/03.
L' informativa privacy, ai sensi e per gli effetti di cui all'art. 13 del D.lgs 196/03, e' consultabile all' indirizzo web
www.franzini.it/informativa.htm.

The informations provided will be processed manually and electronically by the data manager and will be disclosed to third parties for the management of economic and sending promotional materials; any refusal to treatment does not allow its proper implementation. You have access to these datas and other rights in accordance with art. 7 - D.Lgs.196/03. The privacy policy, in accordance with and for purposes of Art. 13 of Legislative Decree 196/03, is available at website
www.franzini.it/informativa.htm.

Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque, destinate esclusivamente alle persone o alla Società sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p. , che ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di informarci immediatamente per telefono allo 0522.929411 o inviando un messaggio all’indirizzo e-mail
mbox@xxxxxxxxxxx . Inoltre, il messaggio da Voi ricevuto è di natura non personale e le risposte al presente, potranno essere conosciute nell’organizzazione di appartenenza del mittente.

The information in this e-mail (which includes any files transmitted with it) is confidential and may also be legally privileged. It is intended for the addressee only. Access to this e-mail by anyone else is unauthorised. It is not to be relied upon by any person other than the addressee, except with our prior written approval. If no such approval is given, we will not accept any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting on such information. Unauthorised recipients are required to maintain confidentiality. If you have received this e-mail in error please notify us immediately, destroy any copies and delete it from your computer system. Any use, dissemination, forwarding, printing or copying of this e-mail is prohibited. Copyright in this e-mail and any document created by us will be and remain vested in us and will not be transferred to you. We assert the right to be identified as the author of and to object to any misuses of the contents of this e-mail or such documents.

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