0

The following URI triggered an error in the public OData service:

http://services.odata.org/V4/Northwind/Northwind.svc/Suppliers?$filter=Address eq '<A'

Entity type Supplier contains property Address of type Edm.String. So, the value of Address may contain any UTF-8 character from the definition (see section 6. Primitive data types).

The server responds with:

Runtime Error: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons).

Is the there something wrong with this URI or it is really a problem on the server side (e.g. inappropriate parsing of the $filter query option)?

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
lubosmj
  • 83
  • 1
  • 2
  • 7
  • 1
    I think the " – dotchuZ May 02 '18 at 11:32
  • Yes, without "<" everything works well. I just assumed that when the protocol defines some standards (like support for UTF-8 characters), they should be implemented in the resulting OData service. :{ – lubosmj May 02 '18 at 20:42
  • you should encode this special character, see my answer below. – dotchuZ May 03 '18 at 06:26
  • This behavior is only an issue with the northwind demo service. Most modern OData implementations would accept this request without issues, characters within the string delimiters do not need to be manually encoded. – Chris Schaller Aug 12 '20 at 07:16

1 Answers1

0

You should encode your query URL, e.g. with help of

http://prasannaadavi.com/2014/06/handling-special-characters-in-odata-queries.html

How are special characters handled in an oData query?

In your special case you should try encoding "<A" with "&lt;A"

--> found in https://web.archive.org/web/20150101222238/http://msdn.microsoft.com/en-us/library/aa226544(SQL.80).aspx)

dotchuZ
  • 2,621
  • 11
  • 39
  • 65