Collections:
Set Content-Type to application/json
How to set Content-Type to application/json? The server requires the Content-Type to be application/json.
✍: FYIcenter.com
You can follow this tutorial to set Content-Type to application/json
using the "HTTP Header Manager" Config Element.
1. Copy and create a Test Plan called Azure-Echo-API-JSON-3.jmx.
2.Add a "Config Element > HTTP Header Manager" to "Post a Valid JSON" sampler with the following header lines:
Name: Content-Type Value: application/json
3. Run the test plan with a Debug PostProcessor and open the "View Results Tree" listener.
4. Inspect the request of the "Post a Valid JSON" sampler. You see the header line of "Content-Type: application/json".
5. Of course, you can add any other header lines as required by the server. Examples are: Authorization, Subscription-Key, Application-Key, etc.
The picture below shows you how to set Content-Type to
application/json using the HTTP Header Manager:
Â
⇒ JSON Extractor - Capture JSON Data
⇠HTTP POST with JSON Message
⇑ Working With JSON Body Messages
⇑⇑ Apache JMeter Tutorials
2020-03-03, 24842👍, 2💬
Popular Posts:
How to valid IPv6 addresses? In order to help your programming or testing tasks, FYIcenter.com has d...
How to generate test credit card numbers? Test credit card numbers are frequently needed in testing ...
How to perform UUDecode (Unix-to-Unix Decode)? UUEncode is Unix-to-Unix encoding used on Unix system...
How to generate test fractional numbers? Test fractional numbers are numbers with fractions that are...
How to generate IP Addresses? To help you to obtain some IP addresses for testing purpose, FYIcenter...