Custom HTTP Header Setting for GWT Forms

How to configure additional HTTP headers when submitting forms using GWT.
(I use FormPanel to create the form)


Summary

From the accepted answer:

HTTP headers cannot be set using FormPanel. FormPanel wraps standard HTML that doesn't allow you to set custom headers.

+7
source share
1 answer

HTTP headers cannot be set using FormPanel - FormPanel wraps a standard HTML <form> that does not allow you to set custom headers.

To set your own headers, use 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() {...}); 
+4
source

All Articles