Changes between Version 2 and Version 3 of RestApi


Ignore:
Timestamp:
02.09.2011 15:37:26 (9 years ago)
Author:
jri
Comment:

Create topic

Legend:

Unmodified
Added
Removed
Modified
  • RestApi

    v2 v3  
    3333 
    3434{{{ 
    35 curl localhost:8080/core/topic/55 | jsonpretty 
     35curl localhost:8080/core/topic/2676 | jsonpretty 
    3636}}} 
    3737 
     
    7474If the topic doesn’t exist an error `500 Retrieving topic xy failed` is returned. 
    7575(The error response might become more HTTP/REST conform in the furure.) 
     76 
     77=== Create topic === 
     78 
     79**Request** 
     80 
     81{{{ 
     82POST /core/topic 
     83 
     84<the topic> 
     85}}} 
     86 
     87Curl example: 
     88 
     89{{{ 
     90curl -X POST -H Content-Type:application/json -d ' 
     91{type_uri: "dm4.notes.note", 
     92composite: {dm4.notes.title: "My title", dm4.notes.text: "My text"} 
     93}' localhost:8080/core/topic 
     94}}} 
     95 
     96For details about the topic data format see DataFormat#topic. 
     97 
     98**Response** 
     99 
     100{{{ 
     101HTTP/1.1 200 OK 
     102Content-Type: application/json 
     103 
     104{ 
     105  "id": 3298, 
     106  "uri": "", 
     107  "type_uri": "dm4.notes.note", 
     108  "value": "My title", 
     109  "composite": { 
     110    "dm4.notes.title": "My title", 
     111    "dm4.notes.text":"My text" 
     112  } 
     113} 
     114}}}