How can I set additional HTTP headers while submitting forms with GWT.
(I am using FormPanel for building the form)
Summary
From accepted answer:
HTTP headers cannot be set using FormPanel - FormPanel wraps the standard HTML
<form>
, which doesn't allow setting custom headers.
Under Custom response headers, click Add header. Enter the Header name and Header value for the custom response header. Enter any additional custom response headers. Click Save.
In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.
In the web site pane, double-click HTTP Response Headers in the IIS section. In the actions pane, select Add. In the Name box, type the custom HTTP header name. In the Value box, type the custom HTTP header value.
HTTP headers cannot be set using FormPanel
- FormPanel
wraps the standard HTML <form>
, which doesn't allow setting custom headers.
To set your own headers use a RequestBuilder
:
RequestBuilder rb = new RequestBuilder(Method.POST, "http://www.my-server.com");
rb.setHeader("X-My-Header", "VALUE");
Request r = rb.sendRequest(null, new RequestCallback() {...});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With