Hi Endre,
Le 14/02/2013 22:36, Endre Karlson a �crit :
> Source:
https://github.com/woorea/billingstack/blob/master/billingstack/api/controllers/v1.py#L178-L189
>
>
> When I do a POST to this I get:
> root@svc01:~/billingstack# http -v POST
>
http://localhost:9091/v1/merchants '{"name": "test"}'
>
> POST
http://localhost:9091/v1/merchants
> =======================================
>
> Content-Type: application/json
>
> {
> "name": "test"
> }
>
> 400 Bad Request
> ===============
>
> Date: Thu, 14 Feb 2013 21:30:01 GMT
> Status: 400
> Content-Length: 87
> Content-Type: application/json; charset=UTF-8
> Server: WSGIServer/0.1 Python/2.7.3
>
> {
> "debuginfo": null,
> "faultcode": "Client",
> "faultstring": "Unknown argument: \"name\""
> }
>
>
> Is it not possible to get the args from the body into 1 argument?
If by that you mean sending the attributes of a unique parameter in the
body, yet you can but you have to tell it to expose first :
@[ws]expose(ReturnType, body=InputDataType)
def yourfunction(self, inputdata):
pass
This is a recent addition and it has not been properly documented yet
(it is, but on the FunctionArgument which is not a public api, and with
a different name).
Cheers,
Christophe