Reading Image from Web Server in C# proxy

后端 未结 4 1244
粉色の甜心
粉色の甜心 2020-12-21 03:49

I am trying to write a proxy which reads an image from one server and returns it to the HttpContext supplied, but I am just getting character stream back.

I am tryin

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 04:23

    I guess you would need to check the ContentType returned by your WebResponse request.

     if (resp.ContentType.StartsWith("image/"))
     {
       // Do your stuff
     }
    

提交回复
热议问题