Demo files.
Demo files.
Hi,
I have installed Trial version of SecureBridge for Delphi7 but I can not find any folder with demo files. Could you please tell me where can I find it?
Regards,
Max
I have installed Trial version of SecureBridge for Delphi7 but I can not find any folder with demo files. Could you please tell me where can I find it?
Regards,
Max
-
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Demo files.
Hello.
Demo projects are installed together with SecureBridge if you check the appropriate option on the SecureBridge installation. Demo projects are located in the Demos directory that you specify on the SecureBridge installation (e.g., C:\Users\Public\Documents\Devart\SecureBridge for Delphi 7\Demos).
Demo projects are installed together with SecureBridge if you check the appropriate option on the SecureBridge installation. Demo projects are located in the Demos directory that you specify on the SecureBridge installation (e.g., C:\Users\Public\Documents\Devart\SecureBridge for Delphi 7\Demos).
-
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Demo files.
If any other questions come up, please contact us.
Re: Demo files.
Hi, I installed the SecureBridge trial, and connected succesfully a TScHttpWebRequest thru a simple URL in post mode.
Now I want to send different parameters to my TScHttpWebRequest,
I use Delphi7, Tbytes does not exist there.
How can I send the parameters in Delphi7 ?
As I have no experience, an example would be welcome.
Thanks
Bernard
Now I want to send different parameters to my TScHttpWebRequest,
I use Delphi7, Tbytes does not exist there.
How can I send the parameters in Delphi7 ?
As I have no experience, an example would be welcome.
Thanks
Bernard
Re: Demo files.
To solve the "Undeclared identifier: 'TBytes'" error, please add the ScTypes unit to the USES clause of your unit.
Kind regards,
Viktor
Kind regards,
Viktor
Re: Demo files.
Thanks Viktor for your fast reply, I have declared Buf: TBytes and it is fine now.
next step is to load the 'Buf' with a string, I found a demo like:
Buf := TEncoding.UTF8.GetBytes('This is a test that posts this string to a Web server.');
but I get: Undeclared Identifier: TEncoding
How can I load the buffer in Delphi 7 from a string ?
Thanks
Bernard
next step is to load the 'Buf' with a string, I found a demo like:
Buf := TEncoding.UTF8.GetBytes('This is a test that posts this string to a Web server.');
but I get: Undeclared Identifier: TEncoding
How can I load the buffer in Delphi 7 from a string ?
Thanks
Bernard
Re: Demo files.
I found a way to convert the string to UTF8 Bytes, but still things do not work,
there are 4 parameters and they are not received correctly on the https server.
Can you please provide a full Delphi7 example that sends parameters (more than 1) to an TScHttpWebRequest thru a post request (https url)?
I want to buy the component but I need to make it work.
Thanks
Bernard
there are 4 parameters and they are not received correctly on the https server.
Can you please provide a full Delphi7 example that sends parameters (more than 1) to an TScHttpWebRequest thru a post request (https url)?
I want to buy the component but I need to make it work.
Thanks
Bernard
Re: Demo files.
Please note that you can use following code which will work correctly with all IDE versions supported by SecureBridge:
Also please add the ScCLRClasses unit to the USES clause of your unit.
Kindly note that in order to pass parameters you can specify them in URL itsel. For example:
https://example.com/path/to/page?name=f ... r=purple
Please note that you can also use the TScHttpWebRequest.Headers property. You can use the TScHttpWebRequest.Headers.Add method to set the required values.
For example:
Best regards,
Viktor
Code: Select all
Buf := Encoding.UTF8.GetBytes('This is a test that posts this string to a Web server.');
Kindly note that in order to pass parameters you can specify them in URL itsel. For example:
https://example.com/path/to/page?name=f ... r=purple
Please note that you can also use the TScHttpWebRequest.Headers property. You can use the TScHttpWebRequest.Headers.Add method to set the required values.
For example:
Code: Select all
ScHttpWebRequest.Headers.Add('ParamName', 'ParamValue');
Viktor
Re: Demo files.
Thanks Viktor,
I am now trying to send an XML text to an https url, I cannot make it work yet ...
var
Buf : TBytes;
Request: TScHttpWebRequest;
then I have
URL := 'https://yyyyyyyyyy/oauth';
Request := TScHttpWebRequest.Create(URL);
try
Request.Method := rmPost;
Request.ContentType := 'application/x-www-form-urlencoded'; // (I also tried Request.ContentType := 'application/json';)
postdata := ' { '+
'grant_type: "client_credentials",' +
'scope: "pull-channel",'+
'client_id: "xxxxxxxxxxxx",'+
'client_secret: "yyyyyyyyyyyyyyy"' +
'}';
Buf := Encoding.UTF8.GetBytes(postdata);
Request.ContentLength := Length(Buf);
Request.WriteBuffer(Buf);
Response := Request.GetResponse; --> internal server error
Do you see any error in this code ?
Thanks again for your support and have a great weekend !
Bernard
I am now trying to send an XML text to an https url, I cannot make it work yet ...
var
Buf : TBytes;
Request: TScHttpWebRequest;
then I have
URL := 'https://yyyyyyyyyy/oauth';
Request := TScHttpWebRequest.Create(URL);
try
Request.Method := rmPost;
Request.ContentType := 'application/x-www-form-urlencoded'; // (I also tried Request.ContentType := 'application/json';)
postdata := ' { '+
'grant_type: "client_credentials",' +
'scope: "pull-channel",'+
'client_id: "xxxxxxxxxxxx",'+
'client_secret: "yyyyyyyyyyyyyyy"' +
'}';
Buf := Encoding.UTF8.GetBytes(postdata);
Request.ContentLength := Length(Buf);
Request.WriteBuffer(Buf);
Response := Request.GetResponse; --> internal server error
Do you see any error in this code ?
Thanks again for your support and have a great weekend !
Bernard
Re: Demo files.
Hi Bernard,
This error is not related to SecureBridge but to work of the server instead. In order to resolve it please refer to server specifications to get the correct type of ContentType and format of request it expects.
Best regards,
Viktor
This error is not related to SecureBridge but to work of the server instead. In order to resolve it please refer to server specifications to get the correct type of ContentType and format of request it expects.
Best regards,
Viktor