You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "AditiS06 (via GitHub)" <gi...@apache.org> on 2023/05/08 10:06:20 UTC
[GitHub] [jmeter] AditiS06 opened a new issue, #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
AditiS06 opened a new issue, #5897:
URL: https://github.com/apache/jmeter/issues/5897
### Expected behavior
File upload with https POST request should work fine with JMeter 5.5 when Header Manager content-type is set to application/json.
### Actual behavior
_No response_
### Steps to reproduce the problem
I have https POST request, with file upload option.
Header Manager has content-type set to application/json:
<img width="665" alt="image" src="https://user-images.githubusercontent.com/46598865/236793699-052a4cda-f95f-4880-8d47-4f86b4386f90.png">
Once the request is being sent, getting below error:
{"timestamp":"2023-05-08T09:17:39.942+00:00","path":"/EndPoint/URL","status":400,"error":"Bad Request","message":"Invalid value for header 'content-type'. Expected: 'application/json + Given: multipart/form-data; boundary=JAeP7VH8u1DA8_a_3mg51MC70D1STLj","requestId":"ID"}
In Request Headers, content-type is automatically getting set to multipart/form-data even when it is set to application/json in header manager.
<img width="427" alt="image" src="https://user-images.githubusercontent.com/46598865/236794344-12e2b808-d26b-462c-b2d7-b38de2058836.png">
Note: The above error is observed with latest JMeter version i.e. 5.5.
With the older version of JMeter **5.3** the same https request works fine.
### JMeter Version
5.5
### Java Version
openjdk version "1.8.0_362"
### OS Version
OEL 7.9
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] vlsi commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1538275126
That's right. A small jmx thah reproduces the issue would help.
Pull requests that fix issues are welcome as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] AditiS06 commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "AditiS06 (via GitHub)" <gi...@apache.org>.
AditiS06 commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1545198824
Hi Abhijot,
As requested, I have tried making changes to jmeter.properties file as
below:
[image: image.png]
Scenario 1: MIME TYPEis set as "application/json" in Files Upload tab -
[image: image.png]
[image: image.png]
Header Manager has content-type set to - application json.
[image: image.png]
Scenario 2: MIME TYPEis set as "application/json" in Files Upload tab
same as above.
In header manager, content-type is not set explicitly. i.e. the row
content-type set to application/json is not available in header manager.
In both cases, the Request headers tab shows content-type as
multipart/form-data.
[image: image.png]
where as, Request Body hascontent-type set to application/json.
[image: image.png]
I shall see if I can share the .jmx file with a sample request with which I
can reproduce the scenario.
Thanks and Regards,
Aditi Sonawane
On Thu, May 11, 2023 at 6:07 PM Abhijot ***@***.***> wrote:
> Try this modification in jmeter.properties file:
>
> - uncomment line 359 and line 361
> - set 361 true
> - Also try disabling headerManager, if the value on content Type is
> already added to File Upload tab
> [image: image]
> <https://user-images.githubusercontent.com/66517017/237686421-866d5ba5-e3b4-4ad1-a060-ca43ad2d5dd5.png>
>
> Result Tree shows content-Type that was set in File Upload Tab(so it did
> not used multipart, and read the value from http Request).
> So, it may work, As I also didn't saw 2 content Type fields in Request
> Body, after making above change.
>
> Let me know if it works?
> Till then I will test further to confirm accuracy.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/jmeter/issues/5897#issuecomment-1543921945>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALDQVUIDMFTP2CG5ONRUF3LXFTMRVANCNFSM6AAAAAAXZXF5KM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] AditiS06 commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "AditiS06 (via GitHub)" <gi...@apache.org>.
AditiS06 commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1538282376
It will be difficult to share the .jmx file as it contains organization
specific data.
As mentioned in the issue,it is the simple https post request with file
upload. Mime Type is set to application/json and header content-type in
header management is also set to application/json.
If you need any further details please let me know.
Thanks & Regards,
Aditi Sonawane
On Mon, 8 May, 2023, 5:55 pm Vladimir Sitnikov, ***@***.***>
wrote:
> That's right. A small jmx thah reproduces the issue would help.
>
> Pull requests that fix issues are welcome as well
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/jmeter/issues/5897#issuecomment-1538275126>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALDQVUL656YZXDBPL3XZ6A3XFDQ2LANCNFSM6AAAAAAXZXF5KM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] AditiS06 commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "AditiS06 (via GitHub)" <gi...@apache.org>.
AditiS06 commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1543844051
I think yes that is exactly what is happening in case of file upload. It is
replacing the content-type set by user.
Sharing the details for exact same scenario would not be possible for me.
Can we try reproducing the scenario with some sample url and see if helps
in further analysis?
Thanks and Regards,
Aditi Sonawane
On Thu, 11 May, 2023, 10:49 am Abhijot, ***@***.***> wrote:
> I found this bug fix ( issue #5538
> <https://github.com/apache/jmeter/issues/5538> ) it's related:
> [image: image]
> <https://user-images.githubusercontent.com/66517017/237573815-e336ddf1-4b85-40cf-b75a-b5c8f2555366.png>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=65310
>
> It replaces any user set content-type with multipart/header, assuming that
> user may not guess correct header.
> Maybe need a workaround to meet Aditi's scenario?
> @AditiS06 <https://github.com/AditiS06> Can you please try recording test
> scenario maybe with Blaze Meter, or let know if it's possible to do so?
>
> P.S: I'm still looking into if it's the exact cause for bad request and if
> there's a way to get over the contentType value.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/jmeter/issues/5897#issuecomment-1543353890>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALDQVUOAFWK7262N64EMEUDXFRZHJANCNFSM6AAAAAAXZXF5KM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] Ninja-Cyborg commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "Ninja-Cyborg (via GitHub)" <gi...@apache.org>.
Ninja-Cyborg commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1551944893
I've been looking into some things but doesn't have any meaningful conclusion or update on a solution yet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] AditiS06 commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "AditiS06 (via GitHub)" <gi...@apache.org>.
AditiS06 commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1538269953
Hi Vladimir,
With reproducer do we mean a .jmx file?
Thanks & Regards,
Aditi Sonawane
On Mon, 8 May, 2023, 5:27 pm Vladimir Sitnikov, ***@***.***>
wrote:
> Could you share a reproducer?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/jmeter/issues/5897#issuecomment-1538236576>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALDQVUN7FYPRL32QWZ7INRLXFDNSFANCNFSM6AAAAAAXZXF5KM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] Ninja-Cyborg commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "Ninja-Cyborg (via GitHub)" <gi...@apache.org>.
Ninja-Cyborg commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1543353890
I found this bug fix ( issue #5538 ) it's related:
![image](https://github.com/apache/jmeter/assets/66517017/e336ddf1-4b85-40cf-b75a-b5c8f2555366)
https://bz.apache.org/bugzilla/show_bug.cgi?id=65310
It replaces any user set content-type with multipart/header, assuming that user may not guess correct header.
Maybe need a workaround to meet Aditi's scenario?
@AditiS06 Can you please try recording test scenario maybe with Blaze Meter, or let know if it's possible to do so?
P.S: I'm still looking into if it's the exact cause for bad request and if there's a way to get over the contentType value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] Ninja-Cyborg commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "Ninja-Cyborg (via GitHub)" <gi...@apache.org>.
Ninja-Cyborg commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1543921945
Try this modification in jmeter.properties file:
- uncomment line 359 and line 361
- set 361 true
- Also try disabling headerManager, if the value on content Type is already added to File Upload tab
![image](https://github.com/apache/jmeter/assets/66517017/866d5ba5-e3b4-4ad1-a060-ca43ad2d5dd5)
Result Tree shows content-Type that was set in File Upload Tab(so it did not used multipart, and read the value from http Request).
So, it may work, As I also didn't saw 2 content Type fields in Request Body, after making above change.
Let me know if it works?
Till then I will test further to confirm accuracy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] AditiS06 commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "AditiS06 (via GitHub)" <gi...@apache.org>.
AditiS06 commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1547711664
Hi Abhijot,
I have tried this dummy post call:
http://httpbin.org/post
using file upload with the below dummy data:
{
"id": xxx,
"language": "xxxx",
"price": xxx,
}
And I could reproduce the issue with JMeter 5.5.
Hope this helps.
Thanks and Regards,
Aditi Sonawane
On Fri, May 12, 2023 at 11:14 AM aditi sonawane ***@***.***>
wrote:
> Hi Abhijot,
>
> As requested, I have tried making changes to jmeter.properties file as
> below:
> [image: image.png]
>
> Scenario 1: MIME TYPEis set as "application/json" in Files Upload tab -
> [image: image.png]
> [image: image.png]
> Header Manager has content-type set to - application json.
> [image: image.png]
> Scenario 2: MIME TYPEis set as "application/json" in Files Upload tab
> same as above.
> In header manager, content-type is not set explicitly. i.e. the row
> content-type set to application/json is not available in header manager.
>
> In both cases, the Request headers tab shows content-type as
> multipart/form-data.
> [image: image.png]
> where as, Request Body hascontent-type set to application/json.
> [image: image.png]
> I shall see if I can share the .jmx file with a sample request with which
> I can reproduce the scenario.
>
> Thanks and Regards,
> Aditi Sonawane
>
>
> On Thu, May 11, 2023 at 6:07 PM Abhijot ***@***.***> wrote:
>
>> Try this modification in jmeter.properties file:
>>
>> - uncomment line 359 and line 361
>> - set 361 true
>> - Also try disabling headerManager, if the value on content Type is
>> already added to File Upload tab
>> [image: image]
>> <https://user-images.githubusercontent.com/66517017/237686421-866d5ba5-e3b4-4ad1-a060-ca43ad2d5dd5.png>
>>
>> Result Tree shows content-Type that was set in File Upload Tab(so it did
>> not used multipart, and read the value from http Request).
>> So, it may work, As I also didn't saw 2 content Type fields in Request
>> Body, after making above change.
>>
>> Let me know if it works?
>> Till then I will test further to confirm accuracy.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <https://github.com/apache/jmeter/issues/5897#issuecomment-1543921945>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ALDQVUIDMFTP2CG5ONRUF3LXFTMRVANCNFSM6AAAAAAXZXF5KM>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jmeter] vlsi commented on issue #5897: Facing issue with "content-type" header in HTTP Header Manager Using JMeter 5.5 version.
Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi commented on issue #5897:
URL: https://github.com/apache/jmeter/issues/5897#issuecomment-1538236576
Could you share a reproducer?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org