I am trying to get postcard information from LOB.com account using CURL.
lob.com they are providing:
curl https://api.lob.com/v1/postcards/psc_5c002b86ce47537a \
-u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
How can I get the json response using this CURL?
I've used
var httpWebRequest = (HttpWebRequest) WebRequest.Create("https://api.lob.com/v1/postcards/psc_95d1eafeb5b9a766");
httpWebRequest.ContentType = "application/json";
httpWebRequest.Accept = "*/*";
httpWebRequest.Method = "GET";
httpWebRequest.Headers.Add("Authorization", "test_48d2bbf75c2edc75155c401d119bfae5526:");
var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse();
using(var streamReader = new StreamReader(httpResponse.GetResponseStream())) {
gta_allCustomersResponse answer = JsonConvert.DeserializeObject < gta_allCustomersResponse > (streamReader.ReadToEnd());
return answer;
Above code showing 422 (Unprocessable entity) or 400 (Bad request) error if I run this code.