-2

So I am trying to access 'set-cookie' from the response I get from post(). However, I am getting a status code 300 and consequently, I am getting an KeyError: 'set-cookie'

When I read about code 300 it’s multiple choice and that I should get “a list of representation metadata and URI reference(s) from which [I] can choose the one most preferred.” . I wanted to read about how to do that and where it should be done but couldn’t find any sources. Where is that list and how can I choose from it? How can I redirect? note: I never dealt with http request before

W.A
  • 7
  • 2

1 Answers1

4

You've "never dealt with http request before" and at your first attempt you get this. Unlucky.

The first point of order is that you've provided no details of what is implementing the HTTP. Is it php, asp, ruby, serverside JavaScript, Java.... before you ask another question (or ask this one again, since it's likely to be closed) you use the search here to find similar questions. You're not just looking for answers but the level of information which questioners provide and how well received this is.

Fortunately I have a crystal ball and studied hard during my formative years at Hogwarts so I know you are using python.

The 300 status code is a dinosaur which has been ignored by browser makers since....well forever really. I'm guessing it's being thrown up here because your python binding wants to flag an error. Really it should be returning a 5xx code as it seems rather broken. Anyway, if you had looked you might have found this.

This might be related to the "keyerror" or that might be a further problem with your server-side code/config

Community
  • 1
  • 1
symcbean
  • 47,736
  • 6
  • 59
  • 94