anchor.diff:      % but in most cases it's enough to specify just the 'body' field.
       % Path can be any binary compatible with cowboy's router syntax:
       % http://ninenines.eu/docs/en/cowboy/HEAD/guide/routing/ - see matching paths.
  -    #rest_mapping{port = 8080, path = <<"/test1/[:binding]">>, response = #rest_response{code = 206, content_type = <<"text/plain">>,
  +    #rest_mock{port = 8080, path = <<"/test1/[:binding]">>, response = #rest_response{code = 206, content_type = <<"text/plain">>,
           headers = [{<<"a">>, <<"b">>}, {<<"c">>, <<"d">>}], body = <<"this is test1 endpoint">>}},
   
       % Second type of response can be a list of static responses. They are returned in order of the list.
       % If the end of the list is reached, it starts from the beggining again.
  -    #rest_mapping{port = 8080, path = <<"/test2">>, response = [
  +    #rest_mock{port = 8080, path = <<"/test2">>, response = [
           #rest_response{body = <<"lorem ipsum">>},
           #rest_response{body = <<"dolor sit amet,">>},
           #rest_response{body = <<"consectetur adipiscing elit.">>}
  
positive.code:         initial_state = 0},
  
      % If types inside the mapping are not obided by, the appmock will return a 500 Internal server error response.
      #rest_mapping{port = 8080, path = <<"/test3">>, response = some_rubbish_that_will_cause_appmock_to_crash}
  
      % There is a cowboy_req facade module for convenience, called req.
      % It contains most useful functions to get information about incoming requests.
      % They can be used inside response functions.
      #rest_mapping{port = 443, path = <<"/[:binding/[...]]">>,
          response = fun(Req, _State) ->
              Headers = req:headers(Req),
              ContentType = req:header(<<"content-type">>, Req),
  
negative.code:     % Third type are dynamically generated responses. To define such a response, a two argument function must
      % be provided. Args are Req (cowboy req record) and State (custom state of the mapping, passed between requests).
      % Returned value is a tuple containing #mock_resp record and new state.
      #rest_mock{port = 9090, path = <<"/test_with_state">>,
          response = fun(_Req, State) ->
              R = #rest_response{body = <<"Counter: ", (integer_to_binary(State))/binary>>},
              {R, State + 1}
  