xmlhttprequest - Excel 2010 VBA - XMLHTTP -
what purpose of these lines of codes:
xmlhttp.setrequestheader "content-type", "text/xml" xmlhttp.setrequestheader "user-agent", "mozilla/5.0 (windows nt 6.1; rv:25.0) gecko/20100101 firefox/25.0"
i have tried running xmlhttp code .open"get"
, .responsetext
statements , w/o above 2 lines , didn't notice difference in outputs. missing or 2 lines ensure significant parameters? using excel 2010 vba. appreciate insight...
the content-type entity-header field indicates media type of entity-body sent recipient or, in case of head method, media type have been sent had request been get. if no file content uploaded, not server purpose in request header.
the user-agent request-header field contains information user agent originating request. statistical purposes, tracing of protocol violations, , automated recognition of user agents sake of tailoring responses avoid particular user agent limitations. in many cases, skipping header not cause difference web pages served cross browser compatible , not tailored fit user agent.
more details can found in hypertext transfer protocol (http/1.1): semantics , content rfc 7231 section 3.1.1.5 content-type , rfc 7231 section 5.5.3 user-agent
Comments
Post a Comment