Your JSON is valid (as can be tested on http://jsonlint.com).
But this is problematic:
NSData *reqData = [NSData dataWithBytes:[Buchung UTF8String] length:[Buchung length]];
because [Buchung length]
returns the number of (Unicode) characters in the string,
which is different from the number of UTF-8 bytes for non-ASCII characters such as umlauts.
Better use
NSData *reqData = [Buchung dataUsingEncoding:NSUTF8StringEncoding];
Or use NSJSONSerialization
to create the JSON, which gives you an NSData
object
instead of a string.
You might also have to set the HTTP Content-length explicitly, I am not sure if that is necessary:
[request setValue:[NSString stringWithFormat:@"%d", [reqData length]] forHTTPHeaderField:@"Content-Length"];