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

9 views
Skip to first unread message

Dan Kraus

unread,
Apr 24, 2015, 1:29:35 PM4/24/15
to col...@googlegroups.com
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

Andrew Scott

unread,
Apr 24, 2015, 3:57:02 PM4/24/15
to col...@googlegroups.com
response = getPageContext().getResponse();

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/7e750293-29be-4792-93c6-b2792151fee0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Kraus

unread,
Apr 24, 2015, 5:59:49 PM4/24/15
to col...@googlegroups.com
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 :)

-Dan
Reply all
Reply to author
Forward
0 new messages