Closed malves closed 6 years ago
Hi,
I am doing some tests with HttpMock, for each response I receive the Content-Type header is set to text/plain. I have added .AddHeader("Content-Type", "text/html") to my setup to force the header to text/html but my header is overridden:
server .Stub(x => x.Get("/" + pageName)) .AddHeader("Content-Type", "text/html") .Return(@" <html> <head> </head> <body> <a href='http://localhost:4242/Test1'>Test 1</a> <a href='http://localhost:4242/Test2'>Test 2</a> <a href='http://localhost:4242/Test3'>Test 3</a> <a href='http://google.fr'>Test 3</a> </body> </html> ") .OK();
Is there a way to have the content-type header set to another value ?
Thank you
I did not see the AsContentType() method, it's working now.
Sorry
Hi,
I am doing some tests with HttpMock, for each response I receive the Content-Type header is set to text/plain. I have added .AddHeader("Content-Type", "text/html") to my setup to force the header to text/html but my header is overridden:
Is there a way to have the content-type header set to another value ?
Thank you