Add Python API support
See original GitHub issuehttpie is a very cool CLI tool, far better than curl. It would be great if there would a minimal documented API support so that it can also be used as a Python module you can import and make requests with. The way I would expect it to work might be something like this:
>>> from httpie import interpret_args
>>> resp = interpret_args("http GET http://localhost:8000/help")
>>> resp
<Response [200]>
>>> resp.status_code
200
>>>
Thoughts?
Issue Analytics
- State:
- Created 10 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Python and REST APIs: Interacting With Web Services
By using Python and REST APIs, you can retrieve, parse, update, and manipulate the data provided by any web service you're interested in....
Read more >Python API Tutorial: Getting Started with APIs - Dataquest
In this Python API tutorial, learn about APIs by requesting and analyzing data from the international space station using Python.
Read more >How to use an API with Python (Beginner's Guide) - RapidAPI
After registration, go to the NASA API page. Enter its name in the search box at the RapidAPI service or go to the...
Read more >Python/C API Reference Manual — Python 3.11.1 ...
This manual documents the API used by C and C++ programmers who want to write extension modules or embed Python. It is a...
Read more >How To Use Web APIs in Python 3 | DigitalOcean
An API wrapper is code that you install on your system to make the ... the APIs themselves can do will help you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The interesting part of what HTTPie does in this regard is the translation of a command line argument list to the
**kwargs
passed torequests.request()
.If it was to be exposed, then it would look something like this:
HTTPie actually spits out the Python code used to make the request when the
--debug
flag is set:This is a duplicate to #551—let’s use that one as a canonical issue.