Change to fix issue not setting content type header

This commit is contained in:
tom.pallister
2017-04-28 13:04:40 +01:00
parent 1a76c9fbd9
commit be3a2fb6ed
2 changed files with 35 additions and 1 deletions

View File

@ -5,6 +5,7 @@
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
@ -44,7 +45,11 @@
return null;
}
return new ByteArrayContent(await ToByteArray(request.Body));
var content = new ByteArrayContent(await ToByteArray(request.Body));
content.Headers.TryAddWithoutValidation("Content-Type", new[] {request.ContentType});
return content;
}
private HttpMethod MapMethod(HttpRequest request)