javascript - How to send un-named XML data in POST body using HTML form? -
this current request model (using ajax xmlhttp):
post someurl/someurl/someurl http/1.1 host: xxx.yyy.com connection: close content-length: 221 origin: https://xxx.yyy.com x-requested-with: xmlhttprequest user-agent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) chrome/57.0.2987.133 safari/537.36 content-type: text/xml;charset=utf-8 accept: */* accept-encoding: gzip, deflate, br accept-language: en-us,en;q=0.8 <zadata>somexmldata</zadata> i'm sending un-named xml data in body of ajax xmlhttp request.
i want achieve same without ajax (using html form or other method), i'm requesting resource domain, , need render response directly in webpage. (ajax won't work due sop)
i tried many enctype in <form>, couldn't achieve it. help?
update: tried inserting 1 part of xml inside <input> name attribute, , part inside <input> value attribute. this:
xml data: <zadata><param data=somevalue></param></zadata>
<input type="text" name ="<zadata><param data" value="somevalue></param></zadata>"> the request goes this: %3czadata%3e%3cparam+data=somevalue%3e%3c%2fparam%3e%3c%2fzadata%3e
the = symbol inserted , format fine in request, browser url-encodes content. way prevent encoding?
this impossible. isn't format supported forms.
but browser url-encodes content. way prevent encoding?
… yes. make multipart request instead. multipart encoded instead, still isn't want.
you can't format asking using plain html form.
Comments
Post a Comment