Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > HTTPConnection for application/x-www-form-urlencoded

Forum

Search UsersRules
HTTPConnection for application/x-www-form-urlencoded
#1
Active user
Points:: 0
Joined:: Mar 29, 2016

Code
Connection = New HTTPConnection("api.biletinial.com",,,,,,New OpenSSLSecureConnection());
RequestHeaders = New Map();
RequestHeaders.Insert("Content-Type", "application/x-www-form-urlencoded");
Request = New HTTPRequest("/token/", RequestHeaders);
      
Request.SetBodyFromString("username=makman@mallofistanbul.com.tr&password=MzQ2Nzg1NDY0NTY=&grant_type=password");
      
HTTPResponse = Connection.Post(Request);
ResponseText = HTTPResponse.GetBodyAsString();
      
If HTTPResponse.StatusCode = 200 Then
         
EndIf;


How can i use this code? I try connection on postman or other http request test programs. It's working but On 1c platform not working. Please help me.

How can i post this data:

username=makman@mallofistanbul.com.tr
password=MzQ2Nzg1NDY0NTY=
grant_type=password

Profile
#2
Administrator
Points:: 0
Joined:: Feb 25, 2019

Dear Hüseyin Çağrı Bayraktar,

I tried to connect to this resource using https://www.dropbox.com/s/hlth2rpk238jnem/demohttp.zip?dl=0 test data processing and also did not receive a response.
In this case, the connection to another resource is successful. Most likely, you need to specify additional connection parameters, perhaps there are problems with access.

Best regards,
Evgenii

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.