Skip to content
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

request.AddFile(...) quotes parameter name, but request.AddParameter(...) does not. #2271

Open
javizcaino opened this issue Oct 30, 2024 · 0 comments
Labels

Comments

@javizcaino
Copy link

When adding a parameter to a request, it´s name is not quoted when POSTed to the endpoint, in the other hand, when we add a file, it´s parameter name is quoted.
A clear and concise description of what the bug is.

To reproduce this... I have the following code:
request.AddParameter("body", documentRequestBodyContent); request.AddFile("file", filePath);
...where documentRequestBodyContent is just a simple plain text string. This results in the following request (using fiddler)
Screenshot1

As you can see, "body" parameter has no quotes, but "file" parameter does have them.

In the other hand, when using this code:
request.AddParameter("\"body\"", documentRequestBodyContent); request.AddFile("file", filePath);
It throws this other request (again using fiddler):
Screenshot2

Observe that in this case, the "body" parameter is quoted just like "file" one.
I think this is a bug, as I had to manually add the quotes to the parameter name when adding it to the request...

Best regards

@javizcaino javizcaino added the bug label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant