API Testing
API Testing
API testing is done at the most vital and important layer of software
architecture, the Business Layer, for modelling and manipulating data.
2. **Types of APIs:**
- 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:
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."
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.
7. JSON Format:
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.