Forum Discussion

anujabbi's avatar
anujabbi
Contributor
9 years ago

need help with Bulk API for C#

Here is what i built based on curl example:

 

 

var httpWebRequest = (HttpWebRequest)WebRequest.Create("URL here");
httpWebRequest.ContentType = "application/json";
httpWebRequest.Accept = "*/*";
httpWebRequest.Method = "GET";
string credentials = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
httpWebRequest.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(credentials)));
httpWebRequest.Headers.Add("client-id", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=");
httpWebRequest.Headers.Add("Keep-Alive", "true");
httpWebRequest.KeepAlive = true;
httpWebRequest.ContentType= "text/csv";
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();

 

This keeps failing... what am i doing wrong here?

 

No RepliesBe the first to reply