How to mock requests?

Maddo7

Client
Регистрация
09.05.2015
Сообщения
122
Благодарностей
5
Баллы
18
I want to mock a web request on a resource I'm working with.

Let's say there is a call to

https://domain.com/lookup with data {"name": "markus"} and it replies {"success": true}.

I want to mock it so that there is no actual data sent to the server but I still want to return the {"success": true} to the client so the website continues to work.

I saw there is ChangeRequest and ChangeResponse but I couldn't figure out how to not send any data to the server.

 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 789
Благодарностей
1 186
Баллы
113
You can't do that. You can change whatever you want, but it does not mean the back-end server will view it as a success request.
 

Maddo7

Client
Регистрация
09.05.2015
Сообщения
122
Благодарностей
5
Баллы
18

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 789
Благодарностей
1 186
Баллы
113

Maddo7

Client
Регистрация
09.05.2015
Сообщения
122
Благодарностей
5
Баллы
18
I could also mock the response to be what I want but that is not ideal since a real request is sent which is what I would like to avoid.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)