Thursday, September 9, 2010

Re: How to get HTTP Response headers?

Works fine for me:

@Override
public void onResponseReceived(Request request, Response
response)
{
String toPop = "";
for (Header header:response.getHeaders())
toPop += header.getName() + ": " +
header.getValue() + "\n";
Window.alert(toPop);
}

pops up:

X-Powered-By: Servlet/3.0
Server: GlassFish Server Open Source Edition 3.0.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Thu, 09 Sep 2010 23:46:05 GMT

On Sep 9, 5:07 pm, ussuri <michael.glas...@gmail.com> wrote:
> Does the silence mean this is impossible? Or just very difficult?
>
> MG
>
> On Sep 8, 8:45 pm, ussuri <michael.glas...@gmail.com> wrote:
>
> > Hello!
>
> > I can't figure out how I can get HTTP Response header. In
> > com.google.gwt.http.client.RequestCallback.onResponseReceived() method
> > (a callback from RequestBuilder) there is a Response parameter that
> > has getHeder() and getHeaders() methods, but these always return empty
> > strings or nulls.
>
> > FireBug shows that the headers are there, but I can't get them in
> > GWT...
>
> > THanks,
> > MG

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment