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

[OData] recognize parameters in an x-www-form-urlencoded request body #907

Closed
1 task done
tusmester opened this issue Mar 22, 2020 · 0 comments
Closed
1 task done
Assignees
Labels
Milestone

Comments

@tusmester
Copy link
Member

tusmester commented Mar 22, 2020

Currently we expect clients to send parameters in a json formatted body. Some actions are designed to work with a form-urlencoded request body:

FileName=abc.docx&ContentType=File&PropertyName=Binary

These actions also expect to have access to the Form values of the request, which is not possible, because the OData middleware reads the body which makes it impossible for asp.net to parse it, because the body can be read only once.

Solution
  • if the body is formatted as x-www-form-urlencoded key-value pairs, parse it to a similar JObject as we do in case of a json string:

    return ReadToJson(models);

  • make these parameters accessible for the action method, most likely through the OperationCallingContext object.

@tusmester tusmester added this to the Sprint 206 milestone Mar 22, 2020
@tusmester tusmester self-assigned this Mar 24, 2020
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