-
Notifications
You must be signed in to change notification settings - Fork 300
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
Fix to allow specifying restler_multipart_formdata directly in the grammar #341
base: main
Are you sure you want to change the base?
Conversation
Using the following in the dictionary and grammar, with this check-in, files are sent as the body of the corresponding POST request. # Remove this next Content-Type line #primitives.restler_static_string("Content-Type: application/json\r\n"), primitives.restler_refreshable_authentication_token("authentication_token_tag"), primitives.restler_static_string("\r\n"), # Make sure this is here primitives.restler_multipart_formdata("file1"), primitives.restler_static_string("\r\n"), Dictionary: "restler_multipart_formdata": { "file1": [ { "content-disposition": "name=\"file1\"; filename=\"test0.txt\"", "datastream": "c:\\temp\\restler\\test0.txt" }, { "content-disposition": "name=\"file2\"; filename=\"test1.txt\"", "datastream": "c:\\temp\\restler\\test1.txt" } ] },
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restler_mutipart_formdata does not seem to be documented anywhere in any of the .md file.
Could you please add this, or is this just some scaffolding and this doc will come in a future PR?
We did give a try using your branch with .zip file as multipart file as payload. But it is failing at 2 levels:
Cannot deserialize mutations dictionary: An exception occurred during deserialization: Newtonsoft.Json.JsonSerializationException: Could not find member 'restler_multipart_formdata' on object of type 'MutationsDictionary'. Path 'restler_multipart_formdata', |
I have the save 2nd issue as @ijard-akshay Unhandled exception. System.ArgumentException: Could not read dictionary: ERROR: Cannot deserialize mutations dictionary. An exception occurred during deserialization: Newtonsoft.Json.JsonSerializationException: Could not find member 'restler_multipart_formdata' on object of type 'MutationsDictionary'. Path 'restler_multipart_formdata', line 33, position 33. |
Using the following in the dictionary and grammar, with this change, restler_multipart_formdata can be used to send a file as the body of the corresponding
POST request:
Dictionary: