private XpsServices GetServices() { HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://xpsshipper.com/restapi/v1/customers/" + _customerId + "/services"); req.Method = "GET"; req.ContentType = "application/json"; req.Headers.Add("Authorization", "RSIS " + _apiKey); req.Accept = "application/json"; using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse()) using (StreamReader sr = new StreamReader(resp.GetResponseStream())) return(XpsServices.FromJson(sr.ReadToEnd())); }
public static string ToJson(this XpsServices self) { return(JsonConvert.SerializeObject(self, Converter.Settings)); }