Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-03-08 Thread Felix Meschberger
Hi, On 08.03.2010 12:07, Vidar Ramdal wrote: On 08.03.2010 09:08, Vidar Ramdal wrote: > On Thu, Jan 28, 2010 at 3:10 PM, Vidar Ramdal wrote: >> Finally, we implement the logic for choosing either sendHtml() or >> sendJson(), based on: >> 1. The format of the posted data - if

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-03-08 Thread Vidar Ramdal
>>> On 08.03.2010 09:08, Vidar Ramdal wrote: On Thu, Jan 28, 2010 at 3:10 PM, Vidar Ramdal wrote: > Finally, we implement the logic for choosing either sendHtml() or > sendJson(), based on: > 1. The format of the posted data - if JSON is posted (SLING-1172), > return JSON, oth

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-03-08 Thread Felix Meschberger
Hi, On 08.03.2010 11:26, Vidar Ramdal wrote: > On Mon, Mar 8, 2010 at 9:44 AM, Felix Meschberger wrote: >> Hi, >> >> On 08.03.2010 09:08, Vidar Ramdal wrote: >>> On Thu, Jan 28, 2010 at 3:10 PM, Vidar Ramdal wrote: Finally, we implement the logic for choosing either sendHtml() or sendJ

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-03-08 Thread Vidar Ramdal
On Mon, Mar 8, 2010 at 9:44 AM, Felix Meschberger wrote: > Hi, > > On 08.03.2010 09:08, Vidar Ramdal wrote: >> On Thu, Jan 28, 2010 at 3:10 PM, Vidar Ramdal wrote: >>> Finally, we implement the logic for choosing either sendHtml() or >>> sendJson(), based on: >>> 1. The format of the posted data

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-03-08 Thread Felix Meschberger
Hi, On 08.03.2010 09:08, Vidar Ramdal wrote: > On Thu, Jan 28, 2010 at 3:10 PM, Vidar Ramdal wrote: >> Finally, we implement the logic for choosing either sendHtml() or >> sendJson(), based on: >> 1. The format of the posted data - if JSON is posted (SLING-1172), >> return JSON, otherwise return

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-03-08 Thread Vidar Ramdal
On Thu, Jan 28, 2010 at 3:10 PM, Vidar Ramdal wrote: > Finally, we implement the logic for choosing either sendHtml() or > sendJson(), based on: > 1. The format of the posted data - if JSON is posted (SLING-1172), > return JSON, otherwise return HTML > 2. The Accept HTTP header - if set to "applic

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-01-28 Thread Vidar Ramdal
On Wed, Jan 27, 2010 at 12:53 PM, Vidar Ramdal wrote: > HtmlResponse is in the exported in o.a.s.api.servlets, so we probably > can't mess around with it a lot, for backward compatibility. > The HtmlResponse.send() method is public, but I guess it is intended > for use only from SlingPostServlet?

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-01-27 Thread Vidar Ramdal
>> Maybe we could use the Accept header from the request [1] instead - if >> the client wants JSON (by specifying application/json in Accept), let >> it have JSON - if not, return HTML. On Wed, Jan 27, 2010 at 12:08 PM, Alexander Klimetschek wrote: > Yes. Is it possible to set the Accept header f

Re: Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-01-27 Thread Alexander Klimetschek
On Wed, Jan 27, 2010 at 11:21, Vidar Ramdal wrote: > Ah yes, but I think we've been down that road before. What if I > actually want to post to a node called /foobar.json > (node.getName().equals("foobar.json"))? Ok, that might be an issue then. > Maybe we could use the Accept header from the re

Let SlingPostServlet return JSON (WAS: Re: Client JSon Calls)

2010-01-27 Thread Vidar Ramdal
(Continuing this discussion on dev@sling.apache.org - started at http://n3.nabble.com/Client-JSon-Calls-td139540.html#a139540) > On Wed, Jan 27, 2010 at 10:21, Vidar Ramdal wrote: >> It would be nice if there was a way to get JSON output from the >> standard SlngPostServlet, so that way we could