How to set authorization header in HTML form of GET method
P粉617237727
P粉617237727 2023-08-31 12:21:27
0
1
395
<p>I want to submit an HTML form to a server that accepts the form data in <code>queryString</code> along with the authorization header. The server then sends back the HTML document after performing some calculations on the data and authorization headers. </p> <h1>Restrictions</h1> <ol> <li>I can't use JavaScript features like AJAX or fetch because the form submission gets an HTML response that needs to be opened on the browser. </li> <li>For internal reasons, the form also requires the <code>GET</code> method. </li> </ol> <h1>Response</h1> <p>The response received is an HTML document containing JavaScript containing <code>sessionStorage.setItem('data', 'value')</code> which is scoped only to the source. The form exists in the <em>parent.example.com</em> source, and the received HTML document is in the <em>child.example.com</em> source. So we have to go to the <em>child.example.com</em> page like an HTML form redirect. </p>
P粉617237727
P粉617237727

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!