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
I have an object that I want to post to a REST endpoint (I'm using WCF
if that matters) in Json format. The object has a number of
properties, but the Json serializer seems to choke on the one byte[]
property of the object (it throws an exception saying that it can't
convert it to a string).
As a workaround, I'm UTF8 encoding the byte array, making the property
a string, and posting it that way. Is there a better way?
John Sheehan
unread,
Mar 18, 2011, 1:47:03 PM3/18/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
what would a serialized byte array in json look like on the wire?
i'm going to guess that you've found the best way already :)
mgroves
unread,
Mar 18, 2011, 1:52:11 PM3/18/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
I don't know what it *should* look like, but, as a UTF8 string it
looks like:
{
"data": "QmFzZSA2NCBTdHJlYW0="
}
For a byte[] array, WCF seems to expect something like this:
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
This is via RestRequest.AddBody(object) right? For JSON, this just passes through to JSON.NET, so we need to figure how to get that to handle it.
mgroves
unread,
Mar 18, 2011, 9:45:36 PM3/18/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
Yes, I was either using AddBody or request.AddParameter("application/
json",....)
I think we're just going to use Base64 encoding/decoding, but now I
have a different issue: we keep getting an error "Could not load file
or assembly 'Newtonsoft.Json, Version=3.5.0.0". We have
Newtonsoft.Json as a reference in the project, but it's version 4.0,
not 3.5. What am I doing wrong?
John Sheehan
unread,
Mar 18, 2011, 10:00:25 PM3/18/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
That will be fixed in 100.4, coming out this weekend.
John Sheehan
unread,
Mar 18, 2011, 10:01:10 PM3/18/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
Are you using NuGet?
mgroves
unread,
Mar 19, 2011, 9:53:08 PM3/19/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
Yes, I'm using NuGet.
On Mar 18, 10:01 pm, John Sheehan <johnshee...@gmail.com> wrote:
> Are you using NuGet?