Several questions about REST
===

**1) How to work with relationships?**

Let's say I've an Article resource, which is written by an Author.

Basically I'll have something like :

    {
        "article": {
            "id": 1,
            "title": "Foo bar",
            "body": "Lorem ipsum dolor sid amet",
            "published_on": "2011-05-06 21:54:23",
            "author": {
                "id": 25,
                "username": "johndoe"
            }
        }
    }

I'll access my resource at `api/articles/1`

My question is, what is the best way to represent this data?

Should I do something like:

    {
        "article": {
            "id": 1,
            "title": "Foo bar",
            "body": "Lorem ipsum dolor sid amet",
            "published_on": "2011-05-06 21:54:23",
        }
    }

And access author by calling `api/articles/1/author`


Only include author id (subobject identifier)

    {
        "article": {
            "id": 1,
            "title": "Foo bar",
            "body": "Lorem ipsum dolor sid amet",
            "published_on": "2011-05-06 21:54:23",
            "author": {
                "id": 25,
            }
        }
    }

Or including the full relationship as seen above?

----

**2) PUT or POST to create new object?**

Looking on SO and elsewhere, I've noted that both are used to create and/or update object.

As far as I understand, both are valid action but it depends on the context. If I create a subobject related to a previously created object I've to use `POST`. 

Ex: I create a vote for an article, as the Article already exists, I'll `POST` a new vote, however, if I create a new Article, I `PUT` it.

Am I right?

-------

**3) How should we format Date?** 

I've seen that SO use Unix Timestamp, where ISO8601 are mostly used elsewhere.

Is there any "standard" or recommandation about this?

