Click here to Skip to main content
15,914,066 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friend , i want to create custom type from the response stream . Let me clear first.
from mstrAPIURL=http://www.example.com?e={0}(arbitary url) i have to fetch data. for this i have used
following code
string str = string.Empty;
var client = new WebClient();
StreamData = client.OpenRead(mstrAPIURL);

if (StreamData != null)
{
var reader = new StreamReader(StreamData);
str = reader.ReadLine();


}
in the str variable m getting response resultCode=7000&resultDesc=SucessFull
and the response format is fixed. i want to can i create class with properties resultCode and resultDesc. i don want to do string manipulation
Posted
Updated 22-Nov-11 20:58pm
v2

1 solution

As the error speaks it self - "Un-Authorize Request".

You are passing invalid credentials to your HTTP/REST call which are refused by corresponding REST Service/Application. Verify the credentials which you are passing to your REST Call/Service.

If corresponding REST Service/Application is in-scope of your development then you may have a look at my below Tip/Trick to debug it using "Fiddler".

Debug WCF REST Service.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900