c# - HTTP Server response - wrong content type? -
I am creating a server that is capable of storing some images and sending / streaming them to a customer on request should be there. When I request a web browser, it has succeeded in answering the server with an image, but when I send the same HTTP request from the server to my client application, I'm not sure what actually happens (It is believed to be a tile map server at some point, but I'm starting here easy with just one image).
If this is any help, then there is an output from my web browser request:
And here's another one:
Fiddler is saying That I am returning the content-type: text / html; Charset = UTF-8 who looks very badly while trying to back an image in my head.
I am digging around a bit more and it seems that the response is empty, it smells like my server that the image is not being distributed properly to the customer because I Using the code to answer the request:
if (p.http_url.Equals ("/ mappsverver / tile / 0/0/0")) {stream fs = file . Open ("../Maprser / Tile / 0,0,0.png", Flamemade. Open); P.writeSuccess ("image / jpeg"); Fs.CopyTo (p.outputStream.BaseStream); P.outputStream.BaseStream.Flush (); Fs.Close (); } I am using StreamWriter for my stream. Is it that he gives me problems like material?
HTTP server maps content types through other mechanisms to express such information The stream is very low level; It does not distinguish between a text file or a series of bytes for the image.
These classes have the ability to provide more information about the type of document.
Comments
Post a Comment