Effortless API Testing with CLI Prompt Toolkit

I’ve developed a new tool called CLI Prompt Toolkit, which is a command-line interface designed to make HTTP requests similar to how you would with Postman.

What the Code Does
The cli_prompt_toolkit.py script provides an interactive CLI for making HTT…


This content originally appeared on DEV Community and was authored by Jjioo

I've developed a new tool called CLI Prompt Toolkit, which is a command-line interface designed to make HTTP requests similar to how you would with Postman.

What the Code Does
The cli_prompt_toolkit.py script provides an interactive CLI for making HTTP requests.
Here’s what it can do:

  1. HTTP Method Selection:
    You can choose from various HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS) through an interactive prompt.

  2. URL Handling:
    Enter URLs with optional flags and save them for future use. The tool also supports autocompletion for previously used URLs.
    Header Input: Add custom headers to your requests by typing them directly into the prompt.

  3. Body File Handling:
    Load and format JSON files to be used as the body of your HTTP requests.

  4. Response Display:
    View and format the responses from your requests directly in the CLI.

Image description

Why I Created This Tool

I wanted to create a CLI tool that simplifies the process of making HTTP requests from the command line.
While Postman is fantastic for testing APIs with a graphical interface, I saw a need for a lightweight, text-based tool that could be used directly from the terminal.
This project aims to offer an easy-to-use alternative for those who prefer working in the command line or need to automate their HTTP request tasks in scripts.

Git Repo

Upcoming Feature: Working on adding support for cookies to enhance request handling.


This content originally appeared on DEV Community and was authored by Jjioo


Print Share Comment Cite Upload Translate Updates
APA

Jjioo | Sciencx (2024-08-29T02:02:16+00:00) Effortless API Testing with CLI Prompt Toolkit. Retrieved from https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/

MLA
" » Effortless API Testing with CLI Prompt Toolkit." Jjioo | Sciencx - Thursday August 29, 2024, https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/
HARVARD
Jjioo | Sciencx Thursday August 29, 2024 » Effortless API Testing with CLI Prompt Toolkit., viewed ,<https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/>
VANCOUVER
Jjioo | Sciencx - » Effortless API Testing with CLI Prompt Toolkit. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/
CHICAGO
" » Effortless API Testing with CLI Prompt Toolkit." Jjioo | Sciencx - Accessed . https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/
IEEE
" » Effortless API Testing with CLI Prompt Toolkit." Jjioo | Sciencx [Online]. Available: https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/. [Accessed: ]
rf:citation
» Effortless API Testing with CLI Prompt Toolkit | Jjioo | Sciencx | https://www.scien.cx/2024/08/29/effortless-api-testing-with-cli-prompt-toolkit/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.