apimocker icon indicating copy to clipboard operation
apimocker copied to clipboard

Multiple types params path/queryString, body

Open ludovicoloreti opened this issue 5 years ago • 1 comments

Hello, nice work! Really appreciate it.

I have a question regarding having multiple types of params, both in path (var/:id) and in body ({"dynamicValue": "string"}).

How to do with it? I've just read your documentation twice, but it seems hard to solve it.

Need something like this:

url: asd/:firstId/rotfl/:secondId body: "edit" -> {"value":"string"}

So I've got 2 int path (firstId and secondId) and a body in json.

My JSON looks like:

[
  {
    "firstId": 123,
    "list": [
      {
        "secondId": 1,
        "val1": "content of type string",
         "val2": "content of type string",
        "date": "2019-05-27T13:08:44.183Z"
      },
     {
        "secondId": 2,
        "val1": "content of type string",
         "val2": "content of type string",
        "date": "2019-01-27T13:08:44.183Z"
      },
    ]
  },
  {
    "firstId": 456,
    "list": [
      {
        "secondId": 1,
        "val1": "content of type string",
         "val2": "content of type string",
        "date": "2019-02-27T13:08:44.183Z"
      },
     {
        "secondId": 342,
        "val1": "content of type string",
         "val2": "content of type string",
        "date": "2019-03-27T13:08:44.183Z"
      },
    ]
  }
]

Could you please help 'bout this?

ludovicoloreti avatar May 29 '19 14:05 ludovicoloreti

Glad that apimocker is helping you! I don't fully understand your question. So, you are sending a request with params both in the path, and the body. Right? What are you expecting from apimocker? Do you want to send different responses based on params from both the path and the body? I think this should work as long as your parameters all have different keys.

gstroup avatar May 31 '19 22:05 gstroup