You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RestSharp
Hi,
I'm trying to use RestSharp in a WP7 app. The response to my request
contains the desired JSON in its Content property but the Data is
empty and the ErrorMessage reads:
ErrorException {"Data at the root level is invalid. Line 1, position
1."} System.Exception {System.Xml.XmlException}
I don't understand why an XML error occurs when the content is JSON.
David Poulin
unread,
Feb 16, 2011, 3:35:48 AM2/16/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rest...@googlegroups.com
Hi,
Did you try to specify explicitely Request DataFormat ?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RestSharp
Hi,
from this thread (http://groups.google.com/group/restsharp/ browse_thread/thread/f48341bba7f92dd/) I understood that the
Request.DataFormat only works for the request I send not for
deserializing the response I receive (I tried it anyway and it doesn't
change the outcome).
John Sheehan
unread,
Feb 16, 2011, 3:58:34 AM2/16/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rest...@googlegroups.com
Sounds like the content type coming back from the server isn't application/json or text/json or text/x-json so the right deserializer isn't being called up and its defaulting to the Xml one. What's the value of RestResponse.ContentType?
IRDC
unread,
Feb 16, 2011, 4:07:11 AM2/16/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RestSharp
text/plain;charset=UTF-8
IRDC
unread,
Feb 16, 2011, 4:31:35 AM2/16/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RestSharp
Is there a way to set this to a json type?
David Poulin
unread,
Feb 16, 2011, 4:38:41 AM2/16/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rest...@googlegroups.com
While that works, the easier (and recommended way) is to call RestClient.AddHandler("text/plain", new JsonDeserializer()); to associate that content type with the desired deserializer.