![]() Now, run it: you’ll see it running on Finally, you can open a console and run your first command: httprepl But hey, it doesn’t work! □Ĭ.SwaggerDoc( "v1-foo", new OpenApiInfo ) If you haven’t downloaded it yet, this is the link to the Marvel Movies project which I used to explain how to integrate Swagger. You can also set HTTP headers, and perform operations using a body that can come from the console, from a temporary file or from a physical file on your machine. If you run it you can get more info about the usage of the tool.įor instance, one of the things to notice is that with HttpRepl you can interact with HTTP APIs using several HTTP verbs: GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS. Just like most of the CLI tools, HttpRepl exposes a -help flag as well. NET Core 2.1 (or later) installed on your machine. Talking about the tool itself, to install it you must run dotnet tool install -g Microsoft.dotnet-httprepl on a console remember that you must have. It will give us the opportunity to talk about a few details about HttpRepl that you must consider when you use it. ![]() To try this tool you need two things: the tool itself and an API to call.įor the API, I’m going to use the project I’ve created for the article where I explain how to add Swagger to your API. One of its limits is that you must know exactly the URL to call: you can’t discover the endpoints exposed by the target API.Ī less-known tool is HttpRepl: this is a command-line tool built by the ASP.NET team which lets you navigate RESTful HTTP services as if you were navigating folders with the command-line, using cd, dir, and ls. Ever wondered if it’s possible to interact with some APIs using the CLI instead of writing a client or using tools like Postman or Insomnia? One of the most used tools is cURL, that you can use to call an endpoint via HTTP and print the result on the console.
0 Comments
Leave a Reply. |