Square retrofit server mock for testing

前端 未结 11 1392
栀梦
栀梦 2020-12-07 06:54

What\'s the best way to mock a server for testing when using the square retrofit framework.

Potential ways:

  1. Create a new retrofit client and set it

11条回答
  •  情歌与酒
    2020-12-07 07:40

    JSONPlaceholder: Fake Online REST API for Testing and Prototyping

    https://jsonplaceholder.typicode.com/

    ReqresIn: Another Online REST API

    https://reqres.in/

    Postman mock server

    If you want to test customized response payload, the above two might not suit your requirement, then you can try postman mock server. It's quite easy to set up and flexible to define your own request and response payload.

    https://learning.getpostman.com/docs/postman/mock_servers/intro_to_mock_servers/ https://youtu.be/shYn3Ys3ygE

提交回复
热议问题