ios zway authentication - help
Re: ios zway authentication - help
Are you not specifying content type for post request?
Re: ios zway authentication - help
This is my code, I have not specified content type for post request.pofs wrote:Are you not specifying content type for post request?
Code: Select all
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.requestSerializer.cachePolicy = NSURLRequestReloadIgnoringLocalAndRemoteCacheData;
[manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"admin" password:@"admin"];
[manager POST:@"http://192.168.0.12:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_2-0-37/command/on" parameters:nil
success:^(AFHTTPRequestOperation *operation, id DATA) {
NSLog(@"notifications: %@",DATA);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"getNotifications Error : %@",error.description);
}];
Re: ios zway authentication - help
Seems the serializer doesn't specify content type when there's no content.
Why using POST with empty parameters at all?
GET should do the same without this error.
Why using POST with empty parameters at all?
GET should do the same without this error.
Re: ios zway authentication - help
Thanks pofs. It works now. I thought I should use POST for all the commands sending to the device.pofs wrote:Seems the serializer doesn't specify content type when there's no content.
Why using POST with empty parameters at all?
GET should do the same without this error.
During the testing through the web interface these days, I noticed Razberry can be non-responsive (request time out) sometime. I have to reboot it to fix the issue. Is there any solution other than reboot?
Another issue is, at the moment, I am using local ip to control the devices. How can I control them from out door? I know I can log onto find.zwave.me from the web browser to control them. How can I do the same function from iphone app? Can you provide me some sample codes?
I know above questions are not related to this thread. I can open a new thread if needed.