当内容类型标题是image / jpeg时,HTTP响应的内容数据格式是什么?

时间:2012-02-10 13:58:40

标签: http httpwebrequest http-headers mime-types

好奇的是,当内容类型标题是image / jpeg,binary时,HTTP响应主体的内容数据类型格式是什么?在通过Mozilla Firebug查看时无法看到HTTP响应的原始内容,因为它已经弹出了图像。

在与一个人交谈之前,我从来没有这么说过,他告诉他将二进制数据编码成base64格式数据到HTTP响应体。当我们需要这样做时是否有任何用例?

1 个答案:

答案 0 :(得分:10)

这是你得到的响应头。它还包括Content-Type:image / jpeg

HTTP/1.1 200 OK 
Last-Modified: Fri, 10 Feb 2012 14:31:06 GMT
Content-Type: image/jpeg
Content-Length: 20331
Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18)
Date: Fri, 10 Feb 2012 14:31:22 GMT
Connection: Keep-Alive

,原始内容数据为:

......JFIF.............0Photo: Osvaldo Gago
http://www.fotografar.net....Photoshop 3.0.8BIM.......x............beach.....Algarve.....Faro..n..Osvaldo Gago..t.*Creative Commons Atribuition + Share Alike..z..Osvaldo Gago.8BIM........fotografar.net..1.Exif..II*................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................h..............................."...........................$...........,...........d....... ...l............................... .................).............
..."...........\...................................... .......... .C................... 

...................."...........D.....f...*...........................*.....(............................................... 
.. 
....'.................................................IMG:PowerShot G5 JPEG...........Firmware Version 1.00...................................
.........D...%.................@...........