mendix / RestServices

REST service module for Mendix. Supports consuming and publishing REST based services and real-time data synchronization. Supports JSON, form-encoded, multipart and binary data transport.
Apache License 2.0
31 stars 46 forks source link

JSON responses starting with '[' #67

Closed hodch01 closed 9 years ago

hodch01 commented 9 years ago

Rest Module is not accepting a JSON response starting with a '['

java.lang.RuntimeException: java.lang.IllegalArgumentException: Response body does not seem to be a valid JSON Object. A JSON object starts with '{' but found: [{"identifier": "Fastway", "name": "Fastway"}, {"identifier": "Royal Mail", "name": "Royal Mail"}, {"identifier": "DHL", "name": "DHL"}, {"identifier": "Deutsche Post", "name": "Deutsche Post"}, {"identifier": "PostNL", "name": "PostNL"}, {"identifier": "MRW", "name": "MRW"}, {"identifier": "DX", "name": "DX"}]

mweststrate commented 9 years ago

Use getCollection instead, as your service returns a list of objects.

On Wed, Aug 19, 2015 at 1:51 PM, Christopher James Hodges < notifications@github.com> wrote:

Rest Module is not accepting a JSON response starting with a '['

java.lang.RuntimeException: java.lang.IllegalArgumentException: Response body does not seem to be a valid JSON Object. A JSON object starts with '{' but found: [{"identifier": "Fastway", "name": "Fastway"}, {"identifier": "Royal Mail", "name": "Royal Mail"}, {"identifier": "DHL", "name": "DHL"}, {"identifier": "Deutsche Post", "name": "Deutsche Post"}, {"identifier": "PostNL", "name": "PostNL"}, {"identifier": "MRW", "name": "MRW"}, {"identifier": "DX", "name": "DX"}]

— Reply to this email directly or view it on GitHub https://github.com/mendix/RestServices/issues/67.

hodch01 commented 9 years ago

Thanks :)