User Tools

Site Tools


osrfhttp:osrf_over_http

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
osrfhttp:osrf_over_http [2008/03/24 12:13] – Updating; still need to add in examples and syntax for returned objects. error23osrfhttp:osrf_over_http [2022/02/10 13:34] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====Overview====
 +OSRF methods can be called via HTTP as browser requests, returning JSON objects or XML documents.  JSON is the default, though XML can also be specified.  To use XML as the protocol for the request, an XML document must be POSTed; this will not be covered at this time.
  
 +====Syntax for Calling OSRF Via Web Browser:====
 +http://www.<base url>/gateway?format=<return format>&input_format=<input format>&service=<OSRF application name>&method=<Name of Registered OSRF Method>&param=<param1 value>&...&param=<param //n// value> for //n// parameters.
 +
 +//format// and //input_format// are optional; if neither is present then the request will return a JSON object.  To request an XML dococument, "format=XML" and "input_format=JSON" should be used.  If the "input_format=JSON" parameter is not used with a request for an XML document (i.e., "format=XML", then the request will return an error.
 +
 +The value for the //service// parameter is the name of the OpenSRF application; for example, //open-ils.auth//, //open-ils.search//, or //open-ils.actor// The value for the //method// parameter, likewise, is the registered OSRF method to be called.
 +
 +Order matters for the //param// parameters; they must be ordered as they are in the method declaration for the osrf application.
 +
 +====Examples:====
 +===Input Format and Return Format as JSON:===
 +Both of these examples return the same values; the return and input types do not need to be explicitly stated when requesting JSON objects.
 +==Implicit Defaults for Input/Return Type==
 +list some examples
 +==Explicit Declarations of Input/Return Type==
 +list some examples
 +===Return Format as XML===
 +list some examples
 +
 +====Return Status====
 +OSRF methods will return a status as part of the JSON object or XML document.
 +^ STatus      ^ Error Message       ^ Possible Cause          ^
 +| 200    | The request is returned successfully; the //payload// contains the returned object.    ||
 +| 404    | one of the error messages | explanation|
 +| 404   | Row 2 Col 2     | Row 2 Col 3        |
 +
 +
 +FIXME Insert examples (include method header from osrf, request to send to demo.gapines.org, and returned values)\\ 
 +FIXME Create table of Return Status \\ 
 +FIXME Put it in the real wiki! 

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.