Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Template:Orion/ServerAPI"

(Trying to reduce wasted space when reqbody/respbody are not provided)
(Improve on last change, hopefully)
Line 44: Line 44:
 
:{{{method}}}
 
:{{{method}}}
 
;Example Request
 
;Example Request
  <span style="color:green">{{{method}}} {{{reqhead}}}</span>
+
  <span style="color:green">{{{method}}} {{{reqhead}}}</span>{{{#if:{{{reqbody|}}}|<br>  {{{reqbody|}}}|}}}
{{{#if:{{{reqbody|}}}|{{{reqbody|}}}<br>|}}}
+
 
;Example Response
 
;Example Response
  <span style="color:green">HTTP/1.1 {{{resphead}}}</span>
+
  <span style="color:green">HTTP/1.1 {{{resphead}}}</span>{{{#if:{{{respbody|}}}|<br>  {{{respbody|}}}|}}}
{{{#if:{{{respbody|}}}|{{{respbody|}}}<br>|}}}
+
 
;Detailed Explanation
 
;Detailed Explanation
 
:{{{explain}}}
 
:{{{explain}}}
 
</includeonly>
 
</includeonly>

Revision as of 15:09, 28 February 2011

This is a template for documenting REST-oriented Web APIs.

Markup Rendering
{{Orion/ServerAPI
| overview = Obtain file contents
| method = GET
| reqhead = /file/myfile.txt HTTP/1.1
| resphead = 201 OK
| explain = Detailed explanation
}}
Overview
Obtain file contents
HTTP Method
GET
Example Request
GET /file/myfile.txt HTTP/1.1

  
Example Response
HTTP/1.1 201 OK


Detailed Explanation
Detailed explanation


Method

The HTTP Method

Overview

A textual overview of the purpose of the method

reqhead

The HTTP headers of the request

reqbody

The body of the HTTP request

resphead

The HTTP headers of the response

respbody

The body of the HTTP response

Explain

Detailed explanation of this method.


Back to the top