Skip to content
Jose Romaniello edited this page Jul 7, 2011 · 6 revisions

Publish

In order to publish a message, the first thing you need is a TOPIC.

Doing a GET of the TOPIC you will get a response like this:

<?xml version="1.0" encoding="utf-8"?>
<Topic xmlns="http://schemas.datacontract.org/2004/07/TellagoStudios.Hermes.RestService.Facade">
  <id>4e15b4a617b6c41228ba0173</id>
  <name>Weather</name>
  <description />
  
  <links>
    <link uri="http://YourHermesUrl/groups/4e15b4d317b6c41228ba0174"
        rel="Group" 
        mediaType="application/vnd.hermeshub+xml" />
    
    <link uri="http://YourHermesUrl/topics/4e15b4a617b6c41228ba0173"
        rel="Delete" 
        mediaType="application/vnd.hermeshub+xml" />
    
    <link uri="http://YourHermesUrl/topics/4e15b4a617b6c41228ba0173"
        rel="Update" 
        mediaType="application/vnd.hermeshub+xml" />
          
    <link uri="http://YourHermesUrl/messages/topic/4e15b4a617b6c41228ba0173"
        rel="Post Message" 
        mediaType="application/vnd.hermeshub+xml" />
        
    <link uri="http://YourHermesUrl/feed/4e15b4a617b6c41228ba0173"
        rel="Current Feed" 
        mediaType="application/vnd.hermeshub+xml" />
  </links>
</Topic>

To publish a message, the only thing you have to do is to POST something to the "Post Message" relation. An example of REQUEST will be something like this:

POST http://YourHermesUrl/messages/topic/4e15b4a617b6c41228ba0173 HTTP/1.1
Content-Length: 21
Content-Type: text/plain

Drizzle in New York. 

Note that Hermes will respect and use the Content-Type in the subscribers feed.