iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📕

A Beginner's Guide to RESTful API Requests

に公開

I want to leave behind some necessary backend knowledge for QA engineers and testers to level up their skills...!

Why is it good to know?

  • Bug reports become more concrete.
  • You can perform bug triage, which helps in assigning the right people to issues.
    • Reduces the burden on frontend developers.
  • You exude the aura of someone who "understands."
  • Proposals for improvement become more specific.

Frontend vs. Backend

Please refer to the article below, where I have summarized it briefly.
https://zenn.dev/beeeegle/articles/7f107d81a3377c

What is the Backend?

It is a request that simply returns data!
The data retrieved is in a format called JSON.
The beauty (design) of this is extremely important.

Where is it displayed?

You can check it in the browser's Developer Tools.
Using Chrome as an example, you can toggle the display by pressing "F12" on your keyboard.
Furthermore, it is displayed in the "Network" tab within the developer tools.

You can also check it using tools like POSTMAN during testing.

Glossary

JSON

What is JSON?

JavaScript Object Notation is a data-interchange language. It is a lightweight, text-based data exchange format that can be used regardless of the programming language. Its name and syntax are derived from object notation in JavaScript.
Source: wiki

sample
{
    "name": "Test Taro",
    "email": "taro@test.co.jp"
}

Request

What is a Request (HTTP request)?

An HTTP request is a message sent from a client to a server in HTTP (Hypertext Transfer Protocol), which is used to transmit web content. It instructs the server on what files to send.
Source: e-words

Other useful things to remember regarding requests:

Request Methods

Methods such as GET and POST represent the type of request.
This makes it clear exactly what you want to do.

No Term Description
1 GET Method specified when retrieving data (referred to as a resource).
2 POST Method specified when creating a resource.
3 PUT, PATCH Methods specified when updating a resource. PUT and PATCH are sometimes treated the same, but they can be used differently: PUT for full updates and PATCH for partial updates.
4 DELETE Method specified when deleting a resource. It physically (completely) removes it from the database.

Path Parameters

These include specific retrieval criteria in the URL (URI).
In the example below, if you want to edit data for item No. 1 registered in the DB, you would request as follows, where the bold part is the item ID.

This is used when retrieving, updating, or deleting detailed information.

http://localhost:1323/items/1/

Query Parameters

These are retrieval conditions used to narrow down multiple pieces of data in the URL (URI), specified after the "?" character.
They are often used when retrieving a list of data.

http://localhost:1323/items?type=mizu&color=blue

Request Body

This is used when registering data, etc.
The format can be JSON or various others.

Content-Type

"Content-Type" is also important, but I will add it later.

Response

What is a Response (HTTP response)?

An HTTP response is a message transmitted from a server to a client in HTTP, which is used for web content transmission. It consists of the HTTP status code and the content of the requested file.
Source: e-words

Postscript

It's invisible in the UI, so it can be difficult at first.
Also, having knowledge of databases will likely deepen your understanding further.
Methods are similar to CRUD in databases.
CRUD: "Create," "Read," "Update," "Delete"

Related

Discussion