0% found this document useful (0 votes)
11 views

API Testing

API testing is a type of software testing that evaluates application programming interfaces to check if they meet requirements. It tests the business logic layer. Key aspects of API testing include RESTful and SOAP APIs, GET, POST, PUT, DELETE methods, status codes, request and response bodies, validating responses, using JSON format, and tools like Postman.

Uploaded by

wardah.2944
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

API Testing

API testing is a type of software testing that evaluates application programming interfaces to check if they meet requirements. It tests the business logic layer. Key aspects of API testing include RESTful and SOAP APIs, GET, POST, PUT, DELETE methods, status codes, request and response bodies, validating responses, using JSON format, and tools like Postman.

Uploaded by

wardah.2944
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Contents

What is API testing? ............................................................................................................... 1


1. **What is API?** ............................................................................................................. 2
2. **Types of APIs:** ........................................................................................................... 2
3. Methods: ........................................................................................................................ 2
4. **Status Codes:** .......................................................................................................... 3
5. **Request Body and Response Body:** ........................................................................... 3
6. **How to Validate API Response:** ................................................................................. 3
7. JSON Format: ................................................................................................................. 3
8. Tool for API Testing:......................................................................................................... 4
9. Headers: ........................................................................................................................ 4

What is API testing?


API testing is a sort of software testing that entails evaluating
application programming interfaces (APIs) to see if they meet
functionality, reliability, performance, and security requirements. Simply
put, API testing is designed to detect defects, inconsistencies, or
departures from an API's expected behaviour. Typically, applications are
divided into three layers:

The user interface is also known as the presentation layer.

For business logical processing, the Business Layer or application user


interface is used.

API testing is done at the most vital and important layer of software
architecture, the Business Layer, for modelling and manipulating data.

Sure, let's break it down into simpler terms:


1. **What is API?**

API stands for Application Programming Interface. Think of it as a


waiter in a restaurant. When you go to a restaurant, you don't go to the
kitchen to order your food; instead, you tell the waiter what you want,
and they go to the kitchen, get your order, and bring it back to you.
Similarly, an API is like a waiter between different software systems. It
allows them to communicate and interact with each other.

2. **Types of APIs:**

APIs can be of different types, such as:

- RESTful APIs: These are a type of web service that follows specific
principles for creating web APIs.

- SOAP APIs: These are another type of web service that uses XML as
a format for communication.

- GraphQL APIs: This is a query language for APIs, giving clients more
control over the data they request.

3. Methods:

Methods are actions you can perform with an API. The main methods
are:

- GET: Used to retrieve data from the server.

- POST: Used to send data to the server to create or update a resource.

- PUT: Used to update data on the server.


- DELETE: Used to delete data from the server.

4. **Status Codes:**

Status codes are like signals the server sends back to tell you whether
your request was successful or encountered an error. For example, 200
means "OK," 404 means "Not Found," and 500 means "Internal Server
Error."

5. **Request Body and Response Body:**

When you make a request to an API, you send some information called
the request body. The server processes this information and sends back
a response body, which contains the data you asked for or an error
message.

6. **How to Validate API Response:**

Validating an API response means checking if the response contains


the expected data and meets certain criteria. For example, if you expect
the response to contain a certain field, you check if that field is present.

7. JSON Format:

JSON stands for JavaScript Object Notation. It's a way of formatting


data that's easy for both humans and machines to read and write. It's
commonly used in APIs for sending data between the client and server.
8. Tool for API Testing:

There are many tools available for testing APIs, such as Postman,
Insomnia, and SoapUI. These tools help you send requests to an API,
inspect the responses, and automate tests to ensure the API behaves as
expected.

9. Headers:
Headers are additional pieces of information included in the request or
response. They provide metadata about the request or response, such
as the content type, authentication tokens, or caching directives.

You might also like