RTC Forums
April 28, 2024, 08:30:32 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Encoded message to a non-RTC HTTPS Server  (Read 4286 times)
zsleo
RTC Expired
*
Posts: 80


« on: January 26, 2013, 02:21:15 AM »

I want to send a URL Encoded message to a non-RTC HTTPS Server and wait for a response.

Any examples?

TIA
Zane
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: January 26, 2013, 02:37:21 AM »

In addition to using the URL_Encode function to encode the String before you assign it to Request.FileName property when preparing your request using the TRtcDataRequest component (as shown in Quick Start Client examples for downloading files), you will probably need to set the Request.Host property to the domain name which you want to send the request to. If that doesn't do the trick, then I will need more details about what the Server is expecting to receive.

Best Regards,
Danijel Tkalcec
Logged
zsleo
RTC Expired
*
Posts: 80


« Reply #2 on: January 26, 2013, 07:24:28 AM »

Thanks Danijel.

Turns out that (D XE) "allowed" me to have the same component name for TRTCHTTPClient and TRTCDataRequest...

Regards

Zane
Logged
zsleo
RTC Expired
*
Posts: 80


« Reply #3 on: January 28, 2013, 08:40:07 AM »

Danijel,

... a follow up query.

After URL_Encode the TRtcDataRequest.Request.Query.Text I am getting failed responses because the recipient is expecting a more extensive encoding. e.g "_" (underscore) == "%5F", ":" == %3A, "/"==%2F and others.

Do you know of an extended URL Encoding parser?

TIA

Zane
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #4 on: January 28, 2013, 09:00:28 AM »

You mean the Server is unable to handle some special characters and needs them to be encoded as well?

If that is the case, then I suggest making your own copy of the URL_Encode function (you will find it in the rtcInfo.pas unit) and writing your own version of it (for example, call it "SpecialURLEncode" and place it in your unit), so you can add encoding for characters which the Server can't handle in plain text.

The function is not complex and should be fairly easy to extend.

Best Regards,
Danijel Tkalcec
Logged
zsleo
RTC Expired
*
Posts: 80


« Reply #5 on: January 28, 2013, 09:31:29 AM »

... though that may be your answer.  Smiley

Thanks

Zane
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.