DEV Community

Discussion on: Faster Than Requests

Collapse
 
datachaz profile image
Charly Wargnier

Hi, great stuff!

I'd like to check the 1st status code in a redirect chain - with request you can do:
df['code'] = df.url.apply(lambda url: requests.get(url, allow_redirects=False).status_code)

How can you do that in faster-than-request?

Thanks,
Charly

Collapse
 
juancarlospaco profile image
Juan Carlos
response["status"]

Responses are just a vanilla simple dict.
:)

Collapse
 
kcespedes profile image
kcespedes

Hi, im new to programming, im tryying to use your faster_than_requests library but cannot get the status code of the requests made.

import faster_than_requests as requests

Exp: response = requests.post(url, "data", http_headers)

I know how to access the response status code with the requests library, but how is it done with yours?

Collapse
 
datachaz profile image
Charly Wargnier

Thanks Juan, although I can't seem to make it work.

Would you mind showing me the full Python syntax on a simple URL please?

Thanks!