Making a GET request via the command line on Ubuntu?

Answered
yaboy01 asked this question 21 days ago
yaboy01 21 days ago

I want to make a simple GET request to an external API.

How can I make the request from the command line?

I'm running Ubuntu 20.04 on my machine if that matters.

2 suggested answers
nick 15 days ago

A simple GET request using curl:

curl 'http://localhost:8080/users/get-all-users'

And you can add URL parameters like you would with any other GET request:

curl 'http://localhost:8080/users/get-user?username=xyz'
0 replies
looper003 15 days ago

Simple:

curl https://jsonplaceholder.typicode.com/posts/1
0 replies
Answered