-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WithBodyFromFile Support #56
Comments
Sounds ok. Method will be like: IResponseBuilder WithBodyFromFile([NotNull] string filename, bool cache =true); |
Thanks for the amazingly quick turn around @StefH. I have three questions,
|
1] This is possible I think. 2] JSONs could be: {
"Guid": "5c5b769a-7cfe-44bd-9801-a4e5fcf9bfc5",
"Priority": 0,
"Request": {
"Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/file"
}
]
},
"Methods": [
"get"
]
},
"Response": {
"StatusCode": 200,
"BodyAsFile": "c:\\temp\\x.json",
"BodyAsFileIsCached": false,
"UseTransformer": false,
"Headers": {}
}
} OR {
"Guid": "55631924-791a-419e-928f-b735e312ab99",
"Priority": 0,
"Request": {
"Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/filecache"
}
]
},
"Methods": [
"get"
]
},
"Response": {
"StatusCode": 200,
"BodyAsBytes": "ew0KICAiaGkiOiAidGVzdCINCn0=",
"BodyAsFileIsCached": true,
"UseTransformer": false,
"Headers": {}
}
} 3] I'll take a look.... |
3] Other files (big files) could increase the memory from a running WireMock too much, so for these files I would use the non-cached version. |
Thanks @StefH, that makes sense. Again thank you so much for the quick turn-around on these enhancements. |
@jrestall ; the NuGet updated at https://www.nuget.org/packages/WireMock.Net/ |
WireMock has support for reading the body content for a stubbed request from a file on disk.
http://wiremock.org/docs/stubbing/#specifying-the-response-body
This is very useful when body content can be very large.
I couldn't find a way to do this in WireMock.Net, I wonder if others would also like to see this support added?
The text was updated successfully, but these errors were encountered: