-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V1.1.0 - Jsondata in Multipart/formdata header APIs defaults to "application/octet-stream" #1710
Comments
@MounarajElangovan can you please confirm if this works: * def temp = {"name": "mike", "age": 27, "validaccount": true}
And multipart file jsondata = { value: '#(temp)' } |
@ptrthomas - It is working when we define data like this, Request log for reference:
|
@MounarajElangovan ok so you are confirming that's a valid workaround ? |
@ptrthomas Yes, I am confirming this is as a valid workaround, I have double checked this with my real time test case also. It is working fine with this workaround. |
@MounarajElangovan thanks ! you have solved a mystery that a few users reported and we were not able to figure out. you also have made me realize that I've fixed this in so for others who land here: if you can't get * url "https://httpbin.org/post"
* def temp = {"name": "mike", "age": 27, "validaccount": true}
* multipart file jsondata = { value: '#(temp)' }
* method post |
@ptrthomas Good morning! Wow! That is great to hear from you. I will try to validate using developer guide. Thanks again for fixing this, it will help us lot. Awesome! |
@ptrthomas I have validated in develop branch, it is working fine. Thanks! |
@nbhattr this is the wrong place for questions like this unless you follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue - so please use stack overflow if needed. that said you should probably spend some time reading this: #1645 (comment) |
1.2.0 released |
Version: 1.1.0
Problem Statement:
In new version of karate, multipart/formdata header APIs are not working as expected when we send both JSON data and files in same API request. This has been working perfectly in lower version (0.9.6).
JSON data in multipart/formdata requests defaults to "application/octet-stream" and content length is always "0".
Here, when we send files alone in multipart/formdata in new version of karate then it is working fine similar to lower versions (Issue occurs when sending JSON also).
I have attached working copy to replicate this issue along with some screenshots of karate reports with API response to differentiate the behavior in older version and current version for better understanding of the issue.
Attachments:
1. Working copy to replicate this issue in local -
multipart-header-working-copy.zip
Command to run: mvn clean test -Dtest=TestRunner
2. JSON defaults to octetstream screenshot -
3. V1.1.0 response screenshot (not expected behavior) -
4. V0.9.6 response screenshot (expected behavior) -
Please check and let me know if you need more information from my side.
The text was updated successfully, but these errors were encountered: