I'm new round here so please be kind.
I need to make a simple request to Sears to retrieve details about a product . I'm not very used to json/xml and with server requests.
As I've already registered to Sears, I have the API key.
My code goes like this:
protected void Page_Load(object sender, EventArgs e)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://api.developer.sears.com/v1/productdetails?&store=Sears&contentType=xml");
request.KeepAlive = false;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream());
string respond = sr.ToString();
Label1.Text = respond;
}
I get the 401 - Unauthorized error
The questions are:
- Where and how do I use the API key ?
- As I suppose i will get an unformatted xml, how do I display it properly ?
Thanks !