POST is used to create new reource in the server. For your question, If we hit the same request 10 times, first time the reource will get create with an id. next time onwards , it throws 422 status- Unprocessed entity. Message says like , "The reource has already been taken". because we are sending the request with same payload everytime.
Hello Sir, Your videos are really helpful Thanks a lot for that. For the question you asked what if we hit POST multiple times with same data(body). The ans is it will create 10 requests and it will give different "id" each time.
post- it is used to create/add new resource. put - it is used to update the existing resource. if we hit same post request multiple times, it will show "429 too many requests" status.
hitting post request in concurrent manner post creat resource every time put not create resource everytime post used for insert data & put is used to update data or if not data is there then create one data
Post is non-idempotent, it means, even if we send the request with the same data, it'll create a new resource. While in case of put, it'll check if the resource is already created, then it'll not create the new one. if there is any change in the body, then it'll update
Idempotent means it’ll have no impact if with the same body, multiple requests are posted. Put is idempotent, it’ll update the data if there is any change in the body content. Whereas POST as the name suggest, post means after. So, it’ll keep on adding the new resource even if the body of the request remains similar
@@shanukhan-ud9gg so lets say the POST API is for creating new login credentials (uid and password), then how can it create same login multiple times with the same credentials? Can you please help?
@@anikaraisa1844 yes, so the above which i've mentioned is in a generic context. while the behavior largely depends on the design and implementation of the API. Eg 1: Intentional Duplication -> based on the business requirement, the API might intentionally allow the creation of multiple user accounts with the same login credentials Eg 2: No Deduplication Logic: The API might not have a deduplication mechanism in place to prevent the creation of multiple accounts with the same credentials, even if the credentials are the same.
@@anikaraisa1844 what i mean is, these are just the generic statements, the implementation is totally based on the business requirements and how the developer is implementing them
When a POST request is triggered multiple times in Postman tool, the following things will happen: The request will be sent to the server multiple times. The server will process the request each time it is received. The server will return a response for each request. The responses will be stored in the Postman history. You can view the responses in the Postman history. If the request is successful, the response will have a status code of 200. If the request is unsuccessful, the response will have a different status code, such as 400, 401, or 403. You can also use Postman to set up a collection runner to run the request multiple times automatically. The collection runner will allow you to specify the number of times the request should be run, as well as the delay between each request. Here are some of the things to keep in mind when triggering a POST request multiple times in Postman: The server may have a limit on the number of requests that can be sent per second. The server may also have a limit on the number of requests that can be sent from the same IP address. If you are sending a lot of requests, you may need to throttle the requests to avoid overloading the server.
It depends on how the server is designed to handle the post request. It may create new request, modifies the existing data or server may not create new data knowing it’s a duplicate request.
Sir close to three years of experience h industry me and I've worked in automation testing projects from the beginning, I've worked in ui testing automation projects, mobile application testing automation protect and currently in api testing automation project. I'm working in an MNC but I feel that my pay is less as per the market standards based on my contribution in the team and my knowledge. I'm trying for a swtich but I don't even get an opportunity for interviews. I don't know why. Can you let me know what can be done in this situation?
Hi sir..... whenever we get the GET request requirement and we are hitting the POST request instead of GET request the status code should be 405 ... In a video it's was showing 404 ..so that's wrong and it is defect....Sir please reply me whether this is correct or not..
HTTP status code 405 is generally considered the best practice to indicate that a requested method is not allowed on an API endpoint. However, the specific handling of this scenario depends on the API developer's design and requirements. If you mistakenly use a POST request on an endpoint that should only accept GET requests, and you receive a 404 status code instead of 405, it may not be considered a best practice. In such cases, you can log a low-priority bug report to address this issue.
Rest Assured will throw an IllegalStateException exception when we pass a wrong content type. The error message will be: Cannot parse object because no supported Content-Type was specified in response. Content-Type was 'text/html;charset=ISO-8859-1'
POST is used to create new reource in the server. For your question, If we hit the same request 10 times, first time the reource will get create with an id. next time onwards , it throws 422 status- Unprocessed entity. Message says like , "The reource has already been taken". because we are sending the request with same payload everytime.
Hi hima bindu do you have linkdin ,i have some doubts in api please could you give it
Hello Sir, Your videos are really helpful Thanks a lot for that. For the question you asked what if we hit POST multiple times with same data(body). The ans is it will create 10 requests and it will give different "id" each time.
Yes. No worries about that. That changes every hits. That's not wrong in that
post- it is used to create/add new resource.
put - it is used to update the existing resource.
if we hit same post request multiple times, it will show "429 too many requests" status.
What is collection
What is payload
Validation in postman
Http code 404 not found
Integration with Jenkins
IllegalstateException
Different variables
hitting post request in concurrent manner post creat resource every time
put not create resource everytime
post used for insert data & put is used to update data or if not data is there then create one data
Post is non-idempotent, it means, even if we send the request with the same data, it'll create a new resource.
While in case of put, it'll check if the resource is already created, then it'll not create the new one. if there is any change in the body, then it'll update
what is the meaning of POST non-idempotent?
And what about Other http methods?
Idempotent means it’ll have no impact if with the same body, multiple requests are posted. Put is idempotent, it’ll update the data if there is any change in the body content.
Whereas POST as the name suggest, post means after. So, it’ll keep on adding the new resource even if the body of the request remains similar
@@shanukhan-ud9gg so lets say the POST API is for creating new login credentials (uid and password), then how can it create same login multiple times with the
same credentials? Can you please help?
@@anikaraisa1844 yes, so the above which i've mentioned is in a generic context. while the behavior largely depends on the design and implementation of the API.
Eg 1: Intentional Duplication -> based on the business requirement, the API might intentionally allow the creation of multiple user accounts with the same login credentials
Eg 2: No Deduplication Logic: The API might not have a deduplication mechanism in place to prevent the creation of multiple accounts with the same credentials, even if the credentials are the same.
@@anikaraisa1844 what i mean is, these are just the generic statements, the implementation is totally based on the business requirements and how the developer is implementing them
Good Questions and Nice Answers.....:)
Hi sir,
If we hit POST request on 10 times by usng diff test data we will get diff output
if we hit the post request 10 times then the created data will be be as it is same but id and time will change .
@RD Automation Learning Please provide answer to that question- " how do you validate test Coverage"?
When a POST request is triggered multiple times in Postman tool, the following things will happen:
The request will be sent to the server multiple times.
The server will process the request each time it is received.
The server will return a response for each request.
The responses will be stored in the Postman history.
You can view the responses in the Postman history.
If the request is successful, the response will have a status code of 200. If the request is unsuccessful, the response will have a different status code, such as 400, 401, or 403.
You can also use Postman to set up a collection runner to run the request multiple times automatically. The collection runner will allow you to specify the number of times the request should be run, as well as the delay between each request.
Here are some of the things to keep in mind when triggering a POST request multiple times in Postman:
The server may have a limit on the number of requests that can be sent per second.
The server may also have a limit on the number of requests that can be sent from the same IP address.
If you are sending a lot of requests, you may need to throttle the requests to avoid overloading the server.
very well explained, thank you
Wow...well explained 🙌
It depends on how the server is designed to handle the post request. It may create new request, modifies the existing data or server may not create new data knowing it’s a duplicate request.
Sir close to three years of experience h industry me and I've worked in automation testing projects from the beginning, I've worked in ui testing automation projects, mobile application testing automation protect and currently in api testing automation project. I'm working in an MNC but I feel that my pay is less as per the market standards based on my contribution in the team and my knowledge.
I'm trying for a swtich but I don't even get an opportunity for interviews. I don't know why. Can you let me know what can be done in this situation?
Hi sir..... whenever we get the GET request requirement and we are hitting the POST request instead of GET request the status code should be 405 ... In a video it's was showing 404 ..so that's wrong and it is defect....Sir please reply me whether this is correct or not..
HTTP status code 405 is generally considered the best practice to indicate that a requested method is not allowed on an API endpoint. However, the specific handling of this scenario depends on the API developer's design and requirements.
If you mistakenly use a POST request on an endpoint that should only accept GET requests, and you receive a 404 status code instead of 405, it may not be considered a best practice. In such cases, you can log a low-priority bug report to address this issue.
Gitlab also best ci cd tool
POST is not impodent - it mean everytime i hit the request, new resource will be created but in case of PUT, its not same case
Assertion Exception will through when we give the wrong content
IllegalStateException exception
415-Unsupported media type for wrong content type
if same POST data is hit again again in 2nd request it will give 401 response
@5:53 wrong content type may return 4XX error code but will RestAssured throw an exception?
I think rest assured will throw exception as a status code of 500 it means server doesn't know how to handle the request.
It won't throw any exception and as you said the response would be 4xx and to be precise it would be 400 or 415
but when i replace get wioth post then send then result i am getting is 201 created...not 404
because the get request data may be deleted because of that reason it gives this status 404
Yes, whenever the request made to database via server and if the data is deleted or not available then it throws 404.
400 status code with bad request
Rest Assured will throw an IllegalStateException exception when we pass a wrong content type. The error message will be:
Cannot parse object because no supported Content-Type was specified in response. Content-Type was 'text/html;charset=ISO-8859-1'
noned