jacwright/RestServer — Issue #7: json data with POST or PUT
Author: phranck
Created: 2011-11-24 07:32:01+00:00
State: open

Hi everyone!

I'm just using this class for a while when Cappuccino 0.9.5 came out. My Cappucino web application uses this RestServer on the backend side pushing raw json data via PUT or POST. But, it seems that RestServer doesn't accept my json data. Here is the code on the client side:

```javascript
var content = "{login:"+ [loginTextField objectValue] +", password:"+ [passwordTextField objectValue] +"}";
var contentLength = [[CPString alloc] initWithFormat:@"%d", [content length]];

[request setHTTPMethod:@"POST"];
[request setHTTPBody:content];
[request setValue:contentLength forHTTPHeaderField:@"Content-Length"];
[request setValue:"application/json" forHTTPHeaderField:@"Content-Type"];
```

My log on the backend side says me that all given parameters ('logon' and 'password' here) are never passed through.
What's wrong here...?

"Thank you for your co-operation" ™