Ultimately the body can be extracted by using HTTPRequestData
HTTPRequestData[]
will return an Association
containing properties and values. Usually you can specify the specific property you want, like "Body"
(I seem to remember some issues getting "MultipartElements"
at some point in time).
obj = CloudDeploy[APIFunction[{}, HTTPRequestData["Body"] &]]
URLExecute[obj, {},
"Body" -> "test"\"test body"body\"",
"Headers" -> {"content-type" -> "text/plain" (*or whatever is appropriate*)},
Method -> "POST"]
"test body"
If your API is actually attached to a form, and your header when making the request is something like:
Content-Type: multipart/form-data
you can use the following
CloudDeploy[APIFunction[{"i"-> "Image"}, #i &,"PNG"]]
This will echo back the image "i" (as labeled in your form). I put "PNG" for display purposes, you should change it to fit your needs.