0

Below code I need to call in c#, how do we can achieve this, please help me.

import requests #requires "requests" package
import json
response = requests.post('https://scm.commerceinterface.com/api/v3/mark_exported',                       data={'supplier_id':'111111111', 'token':'sample-token', 
      'ci_lineitem_ids':json.dumps([54553919,4553920])}).json()
if response['success'] == True:
   #Successfully marked as exported (only items which are not already marked exported)
   pass
else:
   pass
Guy
  • 46,488
  • 10
  • 44
  • 88
Sharad
  • 1,192
  • 1
  • 8
  • 20
  • Possible duplicate of [RestSharp simple complete example](https://stackoverflow.com/questions/10226089/restsharp-simple-complete-example) – coder3521 Nov 08 '17 at 07:17

1 Answers1

1

//I got sollution

C# post request

var client = new RestClient(exportUrl);
            var request = new RestRequest(Method.POST);
            request.AddHeader("cache-control", "no-cache");
            request.AddHeader("content-type", "application/json");
            request.AddParameter("supplier_id", apiSupplierID);
            request.AddParameter("token", apiToken);
            request.AddParameter("ci_lineitem_ids", exportOrders);
            IRestResponse response = client.Execute(request); 

Sharad
  • 1,192
  • 1
  • 8
  • 20