Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using RestSharp;
- using System.Web;
- using System.IO;
- namespace myWorkAppV2
- {
- class voloApi
- {
- public const string volo_username = "aziz.a4c";
- public const string volo_password = "";
- public const string volo_api_url = "http://all4cars.esellerpro.com/eSellerProAPI/services/api/rs/";
- public static void sampleVoloAPiRequest()
- {
- var client = new RestClient();
- client.BaseUrl = new Uri(volo_api_url);
- client.Authenticator = new RestSharp.Authenticators.HttpBasicAuthenticator(volo_username, volo_password);
- var request = new RestRequest("partialProducts", Method.PUT);
- request.AddParameter("StockNumber","100103");
- request.RequestFormat = DataFormat.Xml;
- publicObject.api_stockUpdate item = new publicObject.api_stockUpdate();
- item.Location = "Rezaw - Dropshipping";
- item.Quantity = "33";
- item.StockUpdateType = "Delivery";
- request.AddXmlBody(item);
- //request.AddBody(item);
- var response = client.Execute(request);
- StreamWriter writer = new StreamWriter("apiResult.txt");
- writer.Write(response);
- writer.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement