I was reading the files_put documentation for the Dropbox API.
The URL Path they use is: https://api-content.dropbox.com/1/files_put/<root>/<path>?param=val
and request body holds the file:
required The file contents to be uploaded. Since the entire PUT body will be treated as the file, any parameters must be passed as part of the request URL. The request URL should be signed just as you would sign any other OAuth request URL.
Questions
I am curious to know what is the content-type of this type of request? (file in request body and parameters in url string)
How can this API functionality be mimics? specifically in a grails controller. Something like this.
How would this type of request be tested in
cURL
Update : I found out how to test this with curl here.
For the controller I envisioned something like this
def save () {
withFormt {
html {actForHTML}
<something> {actForREST}
}
}
def actForREST () {
//how can I get access to the file? I guess url parameters can be accessed by `params`
}