We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If i use simple requests, i can convert response to json
in my case, the json has a data and metadata How to convert grequests response in json['data'] to save in database?
def get_data(urls): auth = ENV.AUTH reqs = [grequests.get(link, headers=auth) for link in urls] resp = grequests.map(reqs) return resp example of my json return: ` { "data": [ { "id": 1234567890, "name": "Joe Hussini", "active": true, "email": "[email protected]", "gender_name": "male",
def get_data(urls): auth = ENV.AUTH reqs = [grequests.get(link, headers=auth) for link in urls] resp = grequests.map(reqs) return resp
"preferences": { "calls": true, "sms": true, "correspondence": true, "eletronic_mail": true }, "created_at": "2022-02-23T16:45:27.634-03:00552130650003", "updated_at": "2022-02-23T16:45:27.634-03:00552130650003", "address": { "zipcode": "88888888", "street": "Major Valentine", "number": 1234, "complement": "appartment 21", "neighbour": "B", "state": "Ny", "city": "New York" } } ], "metadata": { "pagination": { "total_count": 1, "total_pages": 122, "page_size": 1, "current_page": 1 } }
} `
The text was updated successfully, but these errors were encountered:
Responses from grequests are requests.Response objects. They work the same way as in requests.
grequests
requests.Response
requests
Note that grequests.map returns a list of responses.
grequests.map
Sorry, something went wrong.
No branches or pull requests
If i use simple requests, i can convert response to json
in my case, the json has a data and metadata
How to convert grequests response in json['data'] to save in database?
def get_data(urls): auth = ENV.AUTH reqs = [grequests.get(link, headers=auth) for link in urls] resp = grequests.map(reqs) return resp
example of my json return:
`
{
"data": [
{
"id": 1234567890,
"name": "Joe Hussini",
"active": true,
"email": "[email protected]",
"gender_name": "male",
}
`
The text was updated successfully, but these errors were encountered: