# Hi, how to validation endpoint is corret

**URL:** <https://community.postman.com/t/hi-how-to-validation-endpoint-is-corret/14895>\
**Category:** Help Hub\
**Created:** [August 11, 2020, 8:01am UTC](https://community.postman.com/t/hi-how-to-validation-endpoint-is-corret/14895 "2020-08-11T08:01:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdhwnkml](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mrdhwnkml](https://community.postman.com/u/mrdhwnkml)\
**Post date:** [August 11, 2020, 8:01am UTC](https://community.postman.com/t/hi-how-to-validation-endpoint-is-corret/14895/1 "2020-08-11T08:01:22Z")

</div>

Hi, I’m Ridhwan

I just learned API testing with postman. and I want to make a test script to validate endpoint is correct. For example:

I have an endpoint: [http://qa-interview.srcli.xyz/](http://qa-interview.srcli.xyz/) and there’s 2 request: POST and GET  
how I made a test script to validate the request is correct?

Best Regards  
Thank you

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 11, 2020, 8:16am UTC](https://community.postman.com/t/hi-how-to-validation-endpoint-is-corret/14895/2 "2020-08-11T08:16:37Z")

</div>

Hey @mrdhwnkml

Welcome to the Postman community! 🚀

Could you include an example of the response body, please? This will help to narrow down what type of things you’re looking to test/check.

What does _correct_ mean to you?

- Is it the response code?
- The response timings?
- Certain headers?
- Ensuring that specific data is in the request body?
- The whole response body?
- Parts of the response body?

---

<div class="post-metadata">

**Author:** ![mrdhwnkml](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mrdhwnkml](https://community.postman.com/u/mrdhwnkml)\
**Post date:** [August 11, 2020, 8:48am UTC](https://community.postman.com/t/hi-how-to-validation-endpoint-is-corret/14895/3 "2020-08-11T08:48:13Z")

</div>

Hi @danny-dainton,

thank you for the welcome.

ok, for example I have endpoint like this : [https://qa-interview.srcli.xyz/login](https://qa-interview.srcli.xyz/login)

and response body is:

```
<html>
<head>
<title></title>
</head>
<body>
<form action="/login" method="post">
 Username:<input type="text" name="username">
 Password:<input type="password" name="password"> 
<input type="submit" value="Login">    
</form>
</body>
</html>

```

and I want to make a script test for:

GET: if:

```
 * already logged in: Returns the 3XX redirect to /
 * not logged in: Displays a login form with a username & password

```

POST: if:

```
 * already logged in: Returns the 3XX redirect to /
 * not logged in: - Returns a 3XX redirect to / if the username & password combination is valid user data and the session_id cookie is set

```

username and password : (root:root123)

Thank You.
