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

Re: [Ftpapi] Help with CCSIDs or URL encoding



Scott,

 

There is obviously something going on that I don’t understand,  I’d appreciate if you could cast an over this to see where I’m going wrong.

 

My job is

Country or region identifier  . . . . . . . . . . :   GB   

Coded character set identifier  . . . . . . . . . :   37   

Default coded character set identifier  . . . . . :   37   

Character identifier control  . . . . . . . . . . :   *DEVD

 

My device is

Keyboard language type . . . . . . :   UKB       

Character identifier . . . . . . . :   697    285

   

The source is:

H option(*srcstmt: *noDebugIO) BNDDIR('HTTPAPI')                         

                                                                          

 /copy qrpglesrc,httpapi_h                                               

                                                                          

D URL             S            300a    varying                           

D response        S         100000a    varying                           

 /free                                                                    

   http_debug(*ON);                                                      

   URL ='';

   clear response;                                                        

   response = http_string('GET'                                          

                          : URL                                          

                          : *omit                                        

                          : *omit);                                      

   *inlr = *on;                                                          

 /end-free  

 

 

The log /tmp/httpapi_debug.txt shows

- - - -  + - - -  - * - -  - - + -  - - - *    ----+----*----+----*

65640D0A                                       ed                  

20696E20 74686520 63616368 650D0A               in the cache       

65733FA2 73656172 63683D22 6D6F6E69 746F7222   es?$search="monitor"

66742E63 6F6D0D0A                              ft.com              

692F312E 33390D0A                              i/1.39           

 

I expect that the $ should be ascii code 24 not A2

 

Regards,

Diarmuid.

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: 15 January 2020 16:43
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Ftpapi] Help with CCSIDs or URL encoding

 

Are you saying that you're providing the characters in the correct CCSID for your job, but that HTTPAPI is not providing them in the correct CCSID for the URL?

I've never heard of anything like this.  Can you tell me how to reproduce the problem?

 

On 1/15/2020 8:04 AM, Diarmuid Drew wrote:

I’ve tried that with a few lines of code,

 

URL = "" +'/'+ %trimr(apiVersion) +'/'+

       %trimr(mailResc) + '?';                       

 URL = "" + http_urlEncode('$select');      

 URL = "" + http_urlEncode('&$filter');     

 clear response;                                   

 response = http_string('GET'                      

                       : URL                       

                       : *omit                     

                       : *omit);                   

 

And I get the following in the debug log

 

GET /v1.0/me/messages?%A2select%26%A2filter HTTP/1.1

Host: graph.microsoft.com                           

User-Agent: http-api/1.39                            

 

The $ sign is still converted to a %A2

 

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Frank Broome
Sent: 13 January 2020 16:01
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Ftpapi] Help with CCSIDs or URL encoding

 

Hi,

 

I believe you need to put message in a variable, e.g. ‘variable’ and use pParm1 = http_urlEncode(variable)

URL = '' + 

      pParm1;

 

Also note that if you hardcode a value it will get the CCSID of the source and if you then run it in a job with different CCSID the runtime value will change, potentially.

 

Best regards,

Frank

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Diarmuid Drew
Sent: Saturday, January 11, 2020 7:08 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Ftpapi] Help with CCSIDs or URL encoding

 

Hi,

 

I’m new to HTTPAPI and sure that this has been asked a few times but my mailing list searches have not provided an answer, possibly my powers are weak. I’m trying to consume a RESTful service and my selection is not working, I get a response from the server but it is not filtering as I requested, ie it is responding with all emails and all fields.

 

The URL I’m accessing is

https://graph.microsoft.com/v1.0/me/messages?$select=sender,subject&$filter=importance eq 'high'

but in the debug log it is showing

GET /v1.0/me/messages?¢select=sender,subject&¢filter=importance%20eq%20'high' HTTP/1.1

The dollar characters are being shown as ¢ (cent)

 

The debug file is CCSID 819 and my job is 37, looking at the debug log in hex it shows

- - - -  + - - -  - * - -  - - + -  - - - *    ----+----*----+----*

65733FA2 73656C65 63743D73 656E6465 722C7375   es?$select=sender,su

 

The dollar is showing as A2 which is the cent sign in the extended ASCII table.

 

My code looks like this (CCSID 37 source file)

 

D URL             S            300a    varying

D response        S         100000a    varying

 

URL = '' + 

      '$select=sender,subject&' +                       

      '$filter=importance eq ''high''';                                     

http_xproc(HTTP_Point_Addl_Header:%paddr(add_hdr));                                           

monitor;                                                

   response = http_string('GET'                         

                         : URL                          

                         : *omit                        

                         : *omit);                      

on-error;                                               

  errorMsg = http_error();                              

  sndmsg(errorMsg);                                      

endmon;

 

 

What should I do to get the correct this?

Thanks

 

 

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more Click Here.



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