POST or GET sample?

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

I have one URL. (Https://abc.com/zz.php)
I want to send a value to this address and get the result.

Is there an example of this?

 
#2
People who like this:1Yes/0No
Just came
Rating: 1
Joined: Jul 31, 2014
Company:

Hello Erdogan,

please try the following code:

Code
   ServerAddress = "abc.com";
   ResourceAddress = "/zz.php";
   Port = 443;
   Timeout = 10;
   
   // Sample value to send
   RequestBody = "id=10";
   
   SecureConnection = New OpenSSLSecureConnection(Undefined, Undefined);
   
   HTTPConnection = New HTTPConnection(ServerAddress, Port,,,, Timeout, SecureConnection);
   
   RequestHeaders = New Map();
   RequestHeaders["Content-Type"] = "application/x-www-form-urlencoded";
   
   Response = Undefined;
   
   HTTPRequest = New HTTPRequest(ResourceAddress, RequestHeaders);
   HTTPRequest.SetBodyFromString(RequestBody);
   
   Try
      Response = HTTPConnection.Post(HTTPRequest);
   Except;
      
      ErrMsg = "An error occured: " + ErrorInfo().Description;
      
      Message(ErrMsg);
      
   EndTry;
   
   // Result
   Body = Response.GetBodyAsString();

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi

You're great.
thank you so much.

 
Subscribe