Bug 65646 - GraphQL Request Sampler sets incorrect Content-Type header of text/plain
Summary: GraphQL Request Sampler sets incorrect Content-Type header of text/plain
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 5.4.1
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: JMETER_5.5
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-22 08:01 UTC by Przemek Wesołek
Modified: 2021-10-22 08:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Przemek Wesołek 2021-10-22 08:01:16 UTC
JSON requests send by GraphQL sampler contain wrong Content-Type header:

    Content-Type: text/plain

which instead should be

    Content-Type: application/json

by default.

One can of course use HTTP Header Manager to set the correct value for all requests, but I think this is only a workaround, as:

  * the default should not be invalid (text/plain Content-Type is invalid for conforming GraphQL server),
  * when mixing GraphQL queries with "standard" HTTP Requests with other content types, adding HTTP Header Manager might require more test reorganization

So I'd suggest just setting application/json as the default content type for GraphQL Request Sampler
Comment 1 The ASF infrastructure team 2022-09-24 20:38:22 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5585