Sign in Go Pro


Handling Requests with RESTMock

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



The Dispatcher is a powerful way to define the desired behavior of MockWebServer. However, the syntax is a bit verbose, and spelling out responses as JSON strings is a bit clumsy. We can use the RESTMock library to make it easier.

In this lesson you will learn:

  • How to set up RESTMock
  • How to use Hamcrest matchers with RESTMock
  • How to tell RESTMock to return the content of a file as response
  • How to verify requests with RESTMock




In the project source code, the "setup" branch does not contains the code showed in the video.

Now there's no source code at all?

You need to go PRO to post comments.

Lessons in MockWebServer