mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-10 19:27:09 +02:00
Body Encoding - admin interface
This commit is contained in:
@@ -15,8 +15,8 @@ namespace WireMock.Net.Tests
|
||||
public async Task Response_ProvideResponse_Handlebars_UrlPathVerb()
|
||||
{
|
||||
// given
|
||||
var bodyAsString = "abc";
|
||||
var body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
string bodyAsString = "abc";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST", body, bodyAsString, Encoding.UTF8);
|
||||
|
||||
var response = Response.Create()
|
||||
@@ -34,8 +34,8 @@ namespace WireMock.Net.Tests
|
||||
public async Task Response_ProvideResponse_Handlebars_Query()
|
||||
{
|
||||
// given
|
||||
var bodyAsString = "abc";
|
||||
var body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
string bodyAsString = "abc";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo?a=1&a=2&b=5"), "POST", body, bodyAsString, Encoding.UTF8);
|
||||
|
||||
var response = Response.Create()
|
||||
@@ -53,8 +53,8 @@ namespace WireMock.Net.Tests
|
||||
public async Task Response_ProvideResponse_Handlebars_Headers()
|
||||
{
|
||||
// given
|
||||
var bodyAsString = "abc";
|
||||
var body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
string bodyAsString = "abc";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST", body, bodyAsString, Encoding.UTF8, new Dictionary<string, string> { { "Content-Type", "text/plain" } });
|
||||
|
||||
var response = Response.Create().WithHeader("x", "{{request.headers.Content-Type}}").WithBody("test").WithTransformer();
|
||||
@@ -71,8 +71,8 @@ namespace WireMock.Net.Tests
|
||||
public async Task Response_ProvideResponse_Encoding_Body()
|
||||
{
|
||||
// given
|
||||
var bodyAsString = "abc";
|
||||
var body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
string bodyAsString = "abc";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST", body, bodyAsString, Encoding.UTF8);
|
||||
|
||||
var response = Response.Create().WithBody("test", Encoding.ASCII);
|
||||
@@ -89,8 +89,8 @@ namespace WireMock.Net.Tests
|
||||
public async Task Response_ProvideResponse_Encoding_JsonBody()
|
||||
{
|
||||
// given
|
||||
var bodyAsString = "abc";
|
||||
var body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
string bodyAsString = "abc";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST", body, bodyAsString, Encoding.UTF8);
|
||||
|
||||
var response = Response.Create().WithBodyAsJson(new { value = "test" }, Encoding.ASCII);
|
||||
|
||||
Reference in New Issue
Block a user