VS Web Load test returning 415 Unsupported Media T

2019-05-18 04:10发布

问题:

I am creating a Web Load test using VS. I am testing a service that I created using WebAPI. The WebAPI works well, I am now trying to do performance/load testing on it.

Here is a picture that shows how I have set up the test:

When I run the test, I get a 415 Unsupported Media Type response back.

Also, you can see that it states in the request that the Content-Type is there:

When inserting headers, I don't see Content-Type listed as one of the options so I just typed it in.

How do I correctly add Content-Type to my load test?

回答1:

From Microsoft's Documentation:

Expand the URL node in the editor, choose the String Body node and in the Content Type property enter a value...