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

Unable to set message body as data-urlencode in HTTP POST #2283

Open
darshan-pandit opened this issue Feb 17, 2025 · 0 comments
Open

Unable to set message body as data-urlencode in HTTP POST #2283

darshan-pandit opened this issue Feb 17, 2025 · 0 comments
Labels

Comments

@darshan-pandit
Copy link

Describe the bug
Unable to set message body as data-urlencode in HTTP POST

It was possible to add rest request parameter as query string or plain text body.
However, I have requirement to pass body as url encoded data, which was not possible.

To Reproduce
restRequest.AddOrUpdateHeader("Authorization", "Basic basc64encodedUsernameColonPassword");
restRequest.AddOrUpdateParameter("queryStringParameter1", "queryStringParameterValue1", ParameterType.QueryString);
restRequest.AddOrUpdateParameter("bodyContent", ParameterType.RequestBody, true);

I was able to make HTTP POST call using Postman
Curl command allows you to pass basic data using parameter --data and to pass url encoded data using parameter --data-urlencode
Postman code snipped shows use of parameter --data-urlencode

curl --location 'https://server:port/export?queryParameter1=queryParameterValue1'
--header 'Authorization: Basic basc64encodedUsernameColonPassword'
--data-urlencode 'some search query with some condition'

Expected behavior
A valid response containing json data was expected, however, I received message saying no data found or empty search.

Desktop (please complete the following information):

  • OS: Windows 10
  • .NET version .NET 8
  • Version 110.2.0
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