Skip to content

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

Open
@javizcaino

Description

@javizcaino

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions