Select to view content in your preferred language

Post Data to REST SOE

526
1
08-05-2010 12:13 AM
HolgerSchade
Deactivated User
Hi,

just out of curiosity. Is it possible to hand over Post Data to a REST ServerObjectExtension, or is this not possible?

I was trying to do something like:

            string jsonString = "{\"text\" : \"87dtzd9\"}";
            WebClient cnt = new WebClient();
            cnt.Headers["Content-type"] = "application/json";
            cnt.Encoding = Encoding.UTF8;
            cnt.DownloadStringCompleted += new DownloadStringCompletedEventHandler(cnt_DownloadStringCompleted);
            cnt.DownloadStringAsync(new Uri(base_url + "/USA/MapServer/exts/AddressService/echo"), jsonString);


instead of handing the parameters over via the URI.
 cnt.DownloadStringAsync(new Uri(base_url + "/USA/MapServer/exts/AddressService/echo?text=87dtzd9"));


What do I need to do on the SOE side, so that the SOE recognizes the post data?

Thanks for a heads up on this 🙂
0 Kudos
1 Reply
BrooksShannon
Deactivated User

What do I need to do on the SOE side, so that the SOE recognizes the post data?


Sorry that this is a late reply - I just saw your posting. 🙂

If you haven't yet found the solution, try setting the PostOnly property of your RestOperation to true.  We've done this and it works well.

Thanks!
Brooks
0 Kudos