Even when I don't include the accept header, my request works and returns the data that I need, however it gets redirected, why?
When you don't specify the Accept header, the server isn't sure that you've asked for JSON, so it answers with 302 Found because it may not be file for what you looked for.