[cups.general] ajax/rest Interface

Michael Sweet msweet at apple.com
Mon Dec 7 15:56:29 PST 2009


On Dec 7, 2009, at 3:35 PM, Pete Morgan wrote:
> So in the case of the http:\\localhost:631 and the http interface, is there a way that can be hacked for ajax ?

Probably; see the following RFCs for a definition of IPP and its message format; you need to POST a chunk of data with the application/ipp content type, and then parse the response that comes back (again, as application/ipp data):

    http://www.rfc-editor.org/rfc/rfc2910.txt
    http://www.rfc-editor.org/rfc/rfc2911.txt

> Am a newbie so here are my questions
> 
> 1) where is the "cgi" protocol is published, ie how to POST/submit stuff (apart from view_source)

The bundled CGI programs do not provide a public API, so they should not be used for anything.

> 2) getting it to return the data in json rather than html

Not possible with the current CGI programs.

> 3) essentially I want interface with json and client side javascript

You might look at writing your own CGI program to run on the print server then; it can convert your client-side requests to real IPP requests and convert the IPP responses to the json data.

___________________________________________________
Michael Sweet, Senior Printing System Engineer







More information about the cups mailing list