Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

python template should use 'requests' #5

Open
philfreo opened this issue Feb 22, 2013 · 4 comments
Open

python template should use 'requests' #5

philfreo opened this issue Feb 22, 2013 · 4 comments

Comments

@philfreo
Copy link

the example python code would be much simpler if it used requests

@tu1ly
Copy link

tu1ly commented Mar 8, 2013

hi, @philfreo - feel free to participate - I will be glad to merge pull request

@Almad
Copy link
Contributor

Almad commented Mar 8, 2013

We have some proposal, but it unfortunately does not handle all cases. I'll post it here so we can collaborate.

@Almad
Copy link
Contributor

Almad commented Mar 11, 2013

@philfreo There is the user-contributed proposal, I just want to do rest of the requests as well (options, head etc.).

Do you know if we can just use getattr(requests, method) and it will work in all cases?

@anemitz
Copy link

anemitz commented Mar 11, 2013

Yup, should work.

honzajavorek added a commit that referenced this issue Jul 23, 2014
Aims of these changes are:
- simplify the example
- introduce the requests library http://docs.python-requests.org/, which is ubiquitous in Python ecosystem these days
- introduce Python2/Python3 compatibility (tested on both)
- fix minor issues with formatting and indentation
- remove unnecessary conversions of body payload according to Content-Type - we already get it as string, we can use it directly as string I suppose

This proposal should supersede both https://github.com/apiaryio/language-templates/tree/python-requests and https://github.com/apiaryio/language-templates/tree/python3 branches. It should also fix #5.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants