ADO.NET Data Services - format parameter - xml / json
Asked Answered
P

3

8

Has the $format parameter been removed with the VS2008 SP1 release of ADO.NET Data Services. I try to use it and I get the error:

The query parameter '$format' begins with a system-reserved '$' character but is not recognized.

I think the support for the Atom stuff is very cool, but can you get "plain old xml" too?

Proscribe answered 3/2, 2009 at 4:7 Comment(1)
Thanks for fixing my title. I must have been half-asleep.Proscribe
C
5

This is now done via the http "Accept" header; use "application/json" for json. You could try "text/xml" for POX, but it isn't mentioned in the article here.

(update: text/xml will return atom, based on the table here)

Cabriolet answered 3/2, 2009 at 8:48 Comment(1)
Wish they would have kept the $format variable for browser-based GET testing. Or provide some way to turn this back on. Guess I could pull out Reflector and have a go at it. Thanks for the info.Proscribe
S
3

Pablo Castro has a clean solution: http://code.msdn.microsoft.com/DataServicesJSONP

It uses WCF behaviors to pick up $format=json

Stoichiometric answered 15/4, 2009 at 2:22 Comment(0)
B
0

This blog post shows how to make the $format=json work using the ASP.NET stack: http://josheinstein.com/blog/index.php/2010/05/wcf-data-services-format-json/

Blindage answered 30/4, 2012 at 2:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.