html - HTTP Request headers vs form data with method POST -


i need upload file server needs authentication code send in request header. need send:

post /upload/file http/1.1 host: www.example.com authorization-code: xxxxx  file data 

i sent post request server via requestmaker.com authorization-code header without file data. server responded ok.

then thought send both file data , authorization-code via html form method=post

i have no in depth knowledge of html, have no idea going on behind scene. thought, method=post send data request header. but, server responded authorization failed. then, inspecting element on webpage, saw browser didn't send form values during request. below output of inspect element->network->header

**general**  remote address:x.x.x.x request url:www.example.com request method:post status code:401 ok  **response headers**  access-control-allow-credentials:true access-control-allow-origin:http://mywebsite.com access-control-expose-headers:content-length, content-type, date, server, transfer-encoding, vary, www-authenticate alternate-protocol:443:quic,p=1 content-length:238 content-type:application/json; charset=utf-8 date:fri, 24 apr 2015 22:15:37 gmt server:uploadserver ("built on apr 20 2015 22:37:13 (1429594633)") status:401 vary:x-origin vary:origin www-authenticate:realm="https://www.example.com"  **request headers**  :authority:www.example.com :method:post :path:/upload/drive/v2/files?uploadtype=media :scheme:https accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 accept-encoding:gzip, deflate accept-language:en-us,en;q=0.8,en-gb;q=0.6 cache-control:max-age=0 content-length:104 content-type:application/x-www-form-urlencoded dnt:1 origin:http://mywebsite.com referer:http://mywebsite.com/uoh/xxx.html user-agent:mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/42.0.2311.90 safari/537.36 x-client-data:cjc2yqeio7bjaqiptskbcms2yqei8ijkaqieksob  **query string parameters**  uploadtype:media  **form data**  authorization-code:xxxx 

can please explain behavior? when post data in forms sent server? suggestion on how can send data in request header?

looks 'authorization-code' should in headers section, before http data section. 'authorization-code' custom header server expect get? (i don't see in standard headers - http://en.wikipedia.org/wiki/list_of_http_header_fields)


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -