[Relax 2] Documenting a resource's body for request

Hi Everyone,

Our API accepts JSON posted in the body of the request. I’m not seeing a way to specify info for the request body on a resource, just params (URL and form). We accept JSON to facilitate more complex data being POSTed to us like:

{ "name": "Dan", "billingAddress": { "address1": "123 Fake St", "state": "NY" } }

Is this not supported or am I simply over looking something? Thanks!

-Dan

response = getPageContext().getResponse();

Hi Andrew,

Thanks, but you’ve misunderstood my question. I’m not asking how to get the body’s response in code. I’m asking how, if possible, can the request’s body be documented in Relax with it’s DSL. I need to define the JSON that gets POSTed up by the client. For example, from a web client via JavaScript sending JSON along.

Relax has a DSL which allows for something like

`
resource(patter="/blah", handler=“blah”, action="‘post’:‘create’}).methods(“POST”).param(…);

`

I was looking for something like another method to chain like .request() or requestBody() or body()

Doesn’t appear to be anything from what I can see so maybe I need to write one and submit a pull request :slight_smile:

-Dan