RTC Forums

Subscription => Support => Topic started by: zsleo on January 26, 2013, 02:21:15 AM



Title: Encoded message to a non-RTC HTTPS Server
Post by: zsleo 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


Title: Re: Encoded message to a non-RTC HTTPS Server
Post by: D.Tkalcec (RTC) 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


Title: Re: Encoded message to a non-RTC HTTPS Server
Post by: zsleo 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


Title: Re: Encoded message to a non-RTC HTTPS Server
Post by: zsleo 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


Title: Re: Encoded message to a non-RTC HTTPS Server
Post by: D.Tkalcec (RTC) 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


Title: Re: Encoded message to a non-RTC HTTPS Server
Post by: zsleo on January 28, 2013, 09:31:29 AM
... though that may be your answer.  :)

Thanks

Zane