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

[Ftpapi] Conversion of characters using http_req



Hi, i have a problem when i send a json using http_req.
For some characters the conversion between as400 and the pc it is not correct. For example on as400 i have this caracter  À writtein in a json file on ifs, but the conversion using http_req it is not correct. If i copy the json file from ifs to pc i can see the correct character.
Here is the code, i use this yail funcion:
to add a tag to json
yajl_addChar('indirizzo': %char(%trim(testa.tlindi)));
to save the file on ifs
 yajl_saveBuf('/lac/ordini.txt':errmsg);

to send the json
 ifssnd = '/lac/ordini.txt';                                          
 ifsrcv = '/lac/risposta.txt';                                        
                                                                     
    rc = http_req( 'POST'                                            
                 : url                                                
                 : ifsrcv                     // File to receive      
                 : *omit                      // String to receive    
                 : ifssnd                     // File to send        
                 : *omit                      // File to send        
                 : 'application/json' );      // String to send      
                                                                     


how is it possible to translate data in a correct way?

The log of the http_req is the following
HTTPAPI Ver 1.41 released 2020-06-05
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R4M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: XXXXXXX.IT
DNS server found: 192.168.0.169
DNS server found: 192.168.0.208
DNS server found: 8.8.8.8
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /webClient/rest/api/importOrders HTTP/1.1
Host: destination.server.eu
User-Agent: http-api/1.41
Content-Type: application/json
Content-Length: 1841340


sendraw(): entered
omitted data......
recvresp(): entered
HTTP/1.1 200 OK
Date: Tue, 29 Jun 2021 10:50:48 GMT
Server: Apache-Coyote/1.1
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked


SetError() £13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
23

chunk size = 35
get_chunk_size returned 35
calling comm_blockread
Importazione avvenuta con successo.
got 35
comm_blockread returned 35


got 2
get_chunk_size(): entered
0

chunk size = 0
get_chunk_size returned 0
http_close(): entered
 

Thank you 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.
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi