Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1405

/$query shall allow Content-Type: application/x-www-form-urlencoded

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.02
    • Component/s: URL Conventions
    • Labels:
      None
    • Proposal:
      Hide

      The request body MUST use the content-type text/plain or application/x-www-form-urlencoded.

      https://github.com/oasis-tcs/odata-specs/pull/170

      Show
      The request body MUST use the content-type text/plain or application/x-www-form-urlencoded . https://github.com/oasis-tcs/odata-specs/pull/170

      Description

      An HTML form can be used to have a browser navigate to the response of an OData request, especially if the response is a stream. If that OData request makes use of the /$query segment, it must have Content-Type: text/plain, which forces an HTML form like

      <form method="post" action="~/$query" enctype="text/plain">
       <input name="$filter" value="a%20eq%201&$select=b"/>
      </form>
      

      Much more natural would be if Content-Type: application/x-www-form-urlencoded were also allowed:

      <form method="post" action="~/$query"
        enctype="application/x-www-form-urlencoded">
       <input name="$filter" value="a eq 1"/>
       <input name="$select" value="b"/>
      </form>
      

      This leads to the same request body as above:

      $filter=a%20eq%201&$select=b
      

      but without forcing the client to percent-encode spaces and insert the ampersand.

        Attachments

          Activity

            People

            • Assignee:
              heiko.theissen Heiko Theissen
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: