Handling 307 Redirects in REST Streaming client

151 views
Skip to first unread message

Shlomo Hecht

unread,
Jan 7, 2016, 10:20:51 AM1/7/16
to Firebase Google Group
Hello
  I am developing a client that uses the Server Sent Events interface  to  firebase
There is a request to support 307 redirects from the server
I do not know the identification of this message and the structure of the data.

thanks
Shlomo

Greg Soltis

unread,
Jan 7, 2016, 12:57:43 PM1/7/16
to Firebase Google Group
Hi, 307 is a standard http status code in a response. It means that the client should try the exact same request again, but at a different URI. That URI is given in the Location header of the response. You can find a summary here: https://httpstatuses.com/307

Hope that helps!

-greg

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/4a1457f7-5d8f-438e-afea-c7829536560c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shlomo Hecht

unread,
Jan 7, 2016, 5:18:44 PM1/7/16
to Firebase Google Group
It helps a lot, but I am looking for the way to read this http header from within the event listener. Even more: what is the event that I am listening too? It is not 'error'. Is it put? Open? Other?

Shlomo

Greg Soltis

unread,
Jan 7, 2016, 5:21:21 PM1/7/16
to Firebase Google Group
Ah, is this from a browser? Most browsers *should* handle the redirect for you. You only need to worry about it if you're using a lower-level http client. From a browser, you can usually verify that it's handling the redirect for you by looking at the Network tab in the dev tools, and looking for the initial request receiving a redirect in response, and then seeing another request afterwards. In general, if you are receiving events in your event handler in a browser, it is probably working.

On Thu, Jan 7, 2016 at 2:18 PM, Shlomo Hecht <shlomo...@gmail.com> wrote:
It helps a lot,  but I am looking for the way to read this http header from within the event listener. Even more: what is the event that I am listening too?  It is not 'error'.  Is it put?  Open? Other?

Shlomo

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

Shlomo Hecht

unread,
Jan 8, 2016, 5:12:29 AM1/8/16
to Firebase Google Group
We are not in a browser. We have low level client.

Greg Soltis

unread,
Jan 8, 2016, 5:58:12 PM1/8/16
to Firebase Google Group
In that case, you need to read the Location header of the response in the event that you get a 307 status code, and then reissue your request to the new URI.

On Fri, Jan 8, 2016 at 2:12 AM, Shlomo Hecht <shlomo...@gmail.com> wrote:
We are not in a browser.  We have low level client.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages