Postman Mock Server Tutorial for Beginners | Mock POST and GET Request in Postman | Postman Tutorial

preview_player
Показать описание
In this Postman Mock Server Tutorial for Beginners, you will learn how to use Postman API Mock Server to test REST APIs in Postman without actual endpoints. You will learn how to use Postman Examples for API Collections to test API endpoints with sample data. You will learn how to test POST and GET methods using Mock Server.
This Postman Tutorial also covers how to do POST body matching in Postman Mock Server for POST verb for API calls.
Рекомендации по теме
Комментарии
Автор

Thank you, this was the first Postman Mocking tutorial I found that explained it in a way I could follow.

freemti
Автор

Thank you so much. I was having trouble understanding how to mock POST requests, and now it makes a lot more sense

carl
Автор

Thanks... I was trying to figure out how these examples worked when defining the mock server. From another tutorial it seemed that you did this from the mock server directly, not the collection... so the mock is created via information that comes from the collection, not the other way around. This makes sense.

karlkrasnowsky
Автор

amzing! learned!I create the require throug the Mock Sever and then use it in the Collection before I watch this vadeo. now I will deleta them and create them by the way of this video

tao
Автор

Hi I am new to postman, i have a question please. do we always have to manually add queries params and their examples with the json that needs to be a response? is there another way where we can add json that has many users in one example then we can pass queries dynamically and we fetch user id without manually creating ids?

UknownCompiler
Автор

@Tutorials Pedia - At 18:01 why did you get 404 error whereas it should have returned 400 as the bad request. 404 is file not found.

sushantsurankar
Автор

Hi Sir, could you explain please: how to get "Bad Request"- responce from the Mock Server if I send a wrong request? for instance, if I send nothing but I must to send some integer. Thank you

igormorozov
Автор

I have a small doubt if I change anything in post request, like if I change any single letter in the body I nee to get like error code 422 .how can I get that . actually I have stucked up there can u help me out

venkatsai
Автор

What am I doing wrong?
I am trying to do this with XML, can you help me?

Best regards.

JoseManuel-loed
Автор

Can I use this mock server For This Mutation in react?
I didn't find any video for this topic, please create a video for this one
Here's an example of a mutation that adds a new todo to the server:



function App() {
const mutation = useMutation({
mutationFn: newTodo => {
return axios.post('/todos', newTodo)
}
})

return (
<div>
{mutation.isLoading ? (
'Adding todo...'
) : (
<>
{mutation.isError ? (
<div>An error occurred:
) : null}

{mutation.isSuccess ? <div>Todo added!</div> : null}

<button
onClick={() => {
mutation.mutate({ id: new Date(), title: 'Do Laundry' })
}}
>
Create Todo
</button>
</>
)}
</div>
)
}

perveziqbal