I got application/x-zip-compressed as Content-Type in the api response
How i get the data in this Zip file to a string in c# code or How i download and read its data
Here is my Request format
public string SendRequest(string Url)
{
string xmlRequestData2 = Url;
string resp = "";
WebResponse response = null;
try
{
try
{
WebRequest request = WebRequest.Create(xmlRequestData2);
request.Method = "GET";
request.Headers["Api-Key"] = "******";
request.Headers["Authorization"] = "*************";
request.ContentType = "application/json";
request.Credentials = new NetworkCredential("aaa", "*************");
response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);
resp = reader.ReadToEnd();
reader.Close();
stream.Close();
}
catch (WebException webException)
{
try
{
WebResponse responses = webException.Response;
Stream streams = responses.GetResponseStream();
String responseMessage = new StreamReader(streams).ReadToEnd();
}
catch (Exception gen)
{
}
}
catch (Exception exception)
{
}
}
finally
{
try
{
response.Close();
}
catch
{
}
}
return resp;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…