Closed stevenao closed 9 years ago
@stevenao Thanks for reporting this. Would you be able to send me a test to reproduce the issue ? Or the tests you are writing
@hibri Sure. I have added a test in the HttpEndPointTests.cs
[TestCase(1)]
[TestCase(100)]
[TestCase(5000)]
public void SUT_should_get_back_exact_content_in_the_last_request_body(int count) {
_stubHttp = HttpMockRepository.At( _hostUrl );
string expected = string.Format( "<xml><>response>{0}</response></xml>", string.Join( " ", Enumerable.Range( 0, count ) ) );
var requestHandler = _stubHttp.Stub( x => x.Post( "/endpoint" ) );
requestHandler.Return( expected ).OK();
Console.WriteLine( _stubHttp.WhatDoIHave() );
using( var wc = new WebClient() ) {
wc.Headers[HttpRequestHeader.ContentType] = "application/xml";
var htmlResult = wc.UploadString( string.Format( "{0}/endpoint", _hostUrl ), expected );
}
var requestBody = requestHandler.LastRequest().Body;
Assert.That( requestBody, Is.EqualTo(expected));
}
@stevenao Pushed a new version with a fix for this. It's in 1.1.6
I am setting a json in the body. I want to check the received request body. I see that the body is truncated.