![]() ![]() I have also played with other demo or toy API servers, such as with it's /posts endpoint. "Content-Type": "application/x-www-form-urlencoded charset=utf-8", $ http -f POST firstname=Kamon lastname=Ayeva Let's now submit a form with data using the /post endpoint. | NOTE: binary data not shown in terminal | $ http Īs another GET request example, we can test the /image/png endpoint which returns a PNG image. This service provides the /get endpoint to help test a GET request, which is what you do when you want to get an HTML page or read some information that is exposed by an API endpoint for that purpose. We can use the service maintained by Kenneth Reitz, to start testing, if we do not have our own testing API server. Getting started with a demo or test service You may want to it call it with the -h option the first time to get see its usage instructions: $ http -h Once done, you can call the HTTPie program by its name, adding the path if needed. $ pip install httpieĪs an alternative, you could use the package manager for your system, such as "apt-get", "yum", "homebrew", or other. That's how I work, but it is just one of the options. Even better, as a good practice of seperating things, in a virtual environment. So you need to install HTTPie firstĪssuming you already have Python 3 installed on your machine, you can install HTTPie as an add-on module for Python. But if you like the idea of being productive using a CLI tool, cURL and httpie are your options. There is actually another good tool I could recommended, Postman, which provides a user interface. ![]() This post will show how to quickly start using those benefits to test APIs. Its goal is to make it easy to interact with HTTP servers, using a simple and natural syntax. HTTPie is an HTTP client and an alternative to the famous cURL. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |