Android http Request / Response ContentType
客户端在进行http请求服务器的时候,需要告诉服务器请求的类型,服务器在返回给客户端的数据的时候,也需要告诉客户端返回数据的类型。 这个类型就是 ContentType ,不同的ContentType 会影响客户端/服务器所看到的效果。contentType: 告诉服务器,我要发什么类型的数据 1、默认的ContentType为 text/html 也就是网页格式. text/plain :纯文本格式 text/xml : XML格式 image/gif :gif图片格式 image/jpeg :jpg图片格式 image/png:png图片格式 以application开头的媒体格式类型: application/xhtml+xml :XHTML格式 application/xml : XML数据格式 application/atom+xml :Atom XML聚合格式 application/json : JSON数据格式 application/pdf :pdf格式 application/msword : Word文档格式 application/oc...