Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > HTTP Service with JSON POST

Forum

Search UsersRules
HTTP Service with JSON POST
#1
Just came
Points:: 0
Joined:: Aug 11, 2017

Hi
I need an example.  HTTP Service with JSON POST.

I could not find in the website.
Please could you share an example?

Profile
#2
Active user
Points:: 0
Joined:: Aug 28, 2015

Hello.
Here's an example:

JSONString = "";// There are several ways you can create your JSON string
ServerAdress = "localhost";
Resource =  "/api/1.0/sync/product/";
HTTP = New HTTPConnection(ServerAdress,,);

HTTPRequest = New HTTPRequest(Resource);
HTTPRequest.SetBodyFromString(JSONString,TextEncoding.UTF8,ByteOrderMarkUsage.DontUse);
Answer = HTTP.Post(HTTPRequest);
Result = Answer.GetBodyAsString("UTF-8");

Profile
#3
Just came
Points:: 0
Joined:: Aug 11, 2017

Thank you Samir, Thank you very much.

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.