January 7, 2026
#1 - GoRest CRUD APIs with curl
Basics of HTTP and REST APIs
What is cURL?
cURL stands for Client URL. It is an open-source project focused on building reliable internet data-transfer tools and libraries.
curl — the command-line HTTP client
A powerful CLI tool used to:
- Send HTTP requests (GET, POST, PUT, DELETE, etc.)
- Work with headers, cookies, authentication, and payloads
- Debug APIs and automate API testing
Command line options
--requestor-X→ HTTP method--locationor-L→ follow redirects--headeror-H→ add header--dump-headeror-D→ dump response header--includeor-i→ include headers in output--outputor-o→ write body to file--write-outor-w→ write metadata%{http_code}%{time_total}
--dataor-d→ send request body--json→ JSON shortcut equivalent to-H "Content-Type: application/json" -d '{...}'--silentor-s→ silent mode--show-erroror-S→ show error only--verboseor-v→ verbose output--failor-f→ fail on HTTP error (exits with non-zero status on 4xx/5xx)--retry→ retries on transient failures (network errors or timeout)--retry-delay→ sleep duration in seconds before retry
--max-time→ terminates request after N seconds
GoRest CRUD APIs
GoRest APIs
- GoRest — https://gorest.co.in/
- Get your access token from https://gorest.co.in/my-account/access-tokens
Setup
export API_TOKEN="<<gorest-access-token>>"
BASE_URI="https://gorest.co.in/public/v2"List Users
Curl command
curl --location \
--request GET --silent --dump-header headers.txt --output response.json --write-out "Status Code: %{http_code}\n" --url "$BASE_URI/users"Making GET request

Response headers

Response body

Display user ids

Create User
Curl command — ensure that email id is unique
curl --location \
--request POST \
--header "Authorization: Bearer $API_TOKEN" \
--silent \
--dump-header headers.txt \
--output response.json \
--write-out "Status Code: %{http_code}\n" \
--url "$BASE_URI/users" \
--json '{
"name": "Test User",
"email": "test_user2@testing.example",
"gender": "male",
"status": "inactive"
}'


Get User
Curl command — update user id
curl --location \
--request GET \
--header "Authorization: Bearer $API_TOKEN" \
--silent \
--dump-header headers.txt \
--output response.json \
--write-out "Status Code: %{http_code}\n" \
--url "$BASE_URI/users/userId"


Update User
Curl command — update user id
curl --location \
--request PUT \
--header "Authorization: Bearer $API_TOKEN" \
--silent \
--dump-header headers.txt \
--output response.json \
--write-out "Status Code: %{http_code}\n" \
--url "$BASE_URI/users/userId" \
--json '{
"status": "active"
}'


Delete User
Curl command — update user id
curl --location \
--request DELETE \
--header "Authorization: Bearer $API_TOKEN" \
--silent \
--dump-header headers.txt \
--output response.json \
--write-out "Status Code: %{http_code}\n" \
--url "$BASE_URI/users/userId"

Why start with cURL?
cURL forces you to understand the raw HTTP contract — endpoint structure, HTTP methods, headers, request payloads, response headers/body, and status codes. If you don't understand APIs at this level, automation will only hide problems, not solve them.
Limitations of cURL for API testing
cURL excels for manual exploration, debugging, and learning HTTP. However, it has significant constraints:
- No built-in assertions (requires visual inspection)
- Lacks test structure and organization
- No reuse mechanism for tokens and base URLs
- No automated reporting capabilities
- Difficult CI/CD integration
These challenges break down fast once testing scales beyond basic use cases.
What's next in this series
Upcoming parts move from cURL to automated testing:
- Migrate cURL logic to the Python
requestslibrary - Introduce the pytest test framework
- Implement assertions on response structure and data
- Refactor configuration (tokens, base URIs) into fixtures
- Develop a maintainable API test framework
Originally published on Hashnode.