Sreedhar Singaraju
05/05/2023, 4:45 AM{
"request": {
"method": "GET",
"urlPattern": "/getbalance"
},
"response": {
"status": 404,
"jsonBody": {
"status": "Error",
"message": "Endpoint not found"
},
"headers": {
"Content-Type": "application/json"
}
}
}
Sreedhar Singaraju
05/05/2023, 4:45 AMShruti Mishra
05/05/2023, 8:58 AMShruti Mishra
05/05/2023, 8:59 AMPreethu Kg
05/05/2023, 10:37 AMMuthukkumar Ponnusamy
05/06/2023, 6:21 AMint
from String "XXXXXXX": not a valid int
value
"status": "{{#if (equals request.body 'hello')}}200{{else}}404{/if}}",
"body": "{{#if (equals response.status 200)}}hello is present{{else}}hello is not present{/if}}"Shruti Mishra
05/08/2023, 9:58 AMShruti Mishra
05/08/2023, 10:01 AMShruti Mishra
05/08/2023, 10:05 AMMuthukkumar Ponnusamy
05/11/2023, 4:11 AMSlackbot
05/11/2023, 6:27 PMMuthukkumar Ponnusamy
05/16/2023, 9:13 PMMaarten Aerts
05/17/2023, 1:54 PMFb
05/17/2023, 2:07 PMTarun Bhalla
05/17/2023, 6:12 PMJulian Michelmann
05/19/2023, 8:20 AMKapish Malik
05/19/2023, 12:50 PMLorenzo Motti
05/19/2023, 1:32 PMBrett Burch
05/19/2023, 4:30 PMMuthukkumar Ponnusamy
05/19/2023, 6:05 PMPOST /__admin/recordings/start
{
"targetBaseUrl": "<http://examples.wiremockapi.cloud/>"
}
transformer: [ "modify-request-body" ]
Sam
05/22/2023, 12:32 PMWatchStaticMappingsInSubdirectories
but cannot see anywhere how to configure the tool to use this
many thanks!mahbaleshwar hegde
05/24/2023, 8:01 AM{
"mappings": [
{
"priority": 1,
"request": {
"method": "GET",
"url": "/posts"
},
"response": {
"status": 200,
"bodyFileName": "posts-default.json"
}
},
{
"priority": 2,
"request": {
"url": "/posts"
},
"response": {
"status": 200,
"bodyFileName": "posts-empty.json"
}
},
{
"priority": 3,
"request": {
"url": "/posts"
},
"response": {
"status": 500,
"bodyFileName": "posts-error.json"
}
}
]
}
Can anyone help me how to achieve one url which has multiple response?Kashyap Achar
05/24/2023, 3:51 PMAmey Gulhane
05/25/2023, 11:12 AMJernej Goricki
05/25/2023, 1:37 PMTanumoy Mitra
05/25/2023, 4:30 PMAlbert Vesker
05/26/2023, 9:51 AMHarsh Singh
05/28/2023, 1:46 PMAnton Smirnov
05/30/2023, 7:51 AMNodir Musaev
05/30/2023, 7:59 AMHello,
By default the .postMapping method creates a stub using an URLRequest with a default Content-Type “application/x-www-form-urlencoded”, which is incorrect. The value of this header should be “application/json” since the body is actually JSON.
I am having an issue where a security equipment between my client code and the mock server blocks all stub creations because of the incorrect value of this HTTP Header.
I tested that the correct value “application/json” works as intended.
Do you think it would be possible to use the correct value for all stub creations please ?
Thank you for your help.
(If you need, I can provide a PR)We are facing same problem. In response data we printed result:
(lldb) po String(data: data!, encoding: .utf8)
▿ Optional<String>
- some : "{\n \"errors\" : [ {\n \"code\" : 10,\n \"source\" : { },\n \"title\" : \"Error parsing JSON\",\n \"detail\" : \"Unexpected character (\'%\' (code 37)): expected a valid value (JSON String, Number, Array, Object or token \'null\', \'true\' or \'false\')\\n at [Source: (String)\\\"... more response data code here