emmett-framework / emmett

The web framework for inventors
Other
1.04k stars 70 forks source link

Getting requests passing headers similar to requests #282

Closed ianshk closed 4 years ago

ianshk commented 4 years ago

I read through the documentation and would like to make a request like the following code using just the emmett request library but unsure how it is possible. How would I go about this without importing the requests package.

url = 'https://' + shop_url + '/admin/api/2020-07/script_tags.json' headers = {'X-Shopify-Access-Token':access_token, 'Accept':'application/json', 'Content-Type':'application/json'}

response = requests.get(url, headers=headers) return response.json()

josejachuf commented 4 years ago

Hi @ianshk I understand that not. py-requests is an http client in python and emmett.request is the object that captures the request to the application. Jose

gi0baro commented 4 years ago

@ianshk I'm not sure about what you asked for, but I think @josejachuf is right here: emmett doesn't not contain an http library.