mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
When proxying, the Content-Type headers get dropped from the request #147
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alefranz on GitHub (Oct 8, 2018).
I'm using the Proxy and Capture functionality but when I do a POST with body, the
Content-Typeheader of the request doesn't get passed to the proxyed service@alefranz commented on GitHub (Oct 8, 2018):
It looks like there is a specific test for this:
f358f13c08/test/WireMock.Net.Tests/FluentMockServerTests.Proxy.cs (L45)however I'm on 1.0.4.17 but experiencing the issue
@alefranz commented on GitHub (Oct 8, 2018):
However that test run only on full framework why I'm experiencing the issue in .NET Core.
Is it a known limitation with .NET Core?
@StefH commented on GitHub (Oct 8, 2018):
I'll check. Thanks for reporting.
@StefH commented on GitHub (Oct 9, 2018):
About the unit-tests : for some reason starting a .NET Core instance from WireMock in a unit-test blocks, as where in .NET Framework 4.5.2, it just starts and listens requests.
However testing the
WithProxy(...)shows that all works.660e97a4ce/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyTests.csCan you maybe provide an example mapping in c# or .json which reproduces your issue?
@StefH commented on GitHub (Oct 9, 2018):
I just did some testing with example application WireMock.Net.Console.NETCoreApp2, file
MainApp.csModified the c# code like this:
When doing a POST to the url

http://{{wm_hostname}}/postI get this:So it seems that the header is correctly passed to the proxy (postman-echo.com)
@alefranz commented on GitHub (Oct 10, 2018):
Apologies for the delay.
Many thanks for spending time looking into my issue.
You can reproduce my issue with the test app using a custom mediatype like
application/vnd.contoso+json@StefH commented on GitHub (Oct 11, 2018):
Can you please try version
1.0.4.18-preview-02from MyGet feed : https://www.myget.org/F/wiremock-net/api/v3/index.jsonI did change some code regarding this logic.
@alefranz commented on GitHub (Oct 15, 2018):
I can't find that specific version, however it works correctly on 1.0.4.18-ci-1343
Thank you!
@StefH commented on GitHub (Oct 15, 2018):
OK Thanks for testing.