Reading Image from Web Server in C# proxy

后端 未结 4 1217
粉色の甜心
粉色の甜心 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

    You're going to need to set the Content Type on your response. Here's a snippet of code that'll do it:

    // specify that the response is a JPEG
    // Also could use "image/GIF" or "image/PNG" depending on what you're
    // getting from the server
    Response.ContentType = "image/JPEG";
    

提交回复
热议问题