Permalink
Browse files

fixed issues with PUT methods not sending query params

  • Loading branch information...
1 parent 50d4075 commit 3163a53a57a7fc3ff7f9f7a3c155056d6fbff51c @zagraves zagraves committed Aug 11, 2009
Showing with 8 additions and 3 deletions.
  1. +8 −3 Source/YOSSocial/YOSUserRequest.m
View
11 Source/YOSSocial/YOSUserRequest.m
@@ -267,6 +267,7 @@ - (BOOL)insertUpdateWithTitle:(NSString *)aTitle
[client setHTTPMethod:@"PUT"];
[client setHTTPBody:updatesHTTPBody];
[client setRequestHeaders:requestHeaders];
+ [client setOauthParamsLocation:@"OAUTH_PARAMS_IN_QUERY_STRING"];
YOSResponseData *response = [client sendSynchronousRequest];
NSInteger httpStatusCode = [response.HTTPURLResponse statusCode];
@@ -306,6 +307,7 @@ - (BOOL)deleteUpdate:(NSString *)aSuid
[client setRequestUrl:url];
[client setHTTPMethod:@"DELETE"];
+ [client setOauthParamsLocation:@"OAUTH_PARAMS_IN_QUERY_STRING"];
YOSResponseData *response = [client sendSynchronousRequest];
NSInteger httpStatusCode = [response.HTTPURLResponse statusCode];
@@ -334,11 +336,11 @@ - (BOOL)setStatus:(NSString *)theMessage
NSMutableDictionary *requestHeaders = [NSMutableDictionary dictionary];
[requestHeaders setObject:@"application/json" forKey:@"Content-Type"];
- NSMutableDictionary *messageDicationary = [NSMutableDictionary dictionary];
- [messageDicationary setObject:theMessage forKey:@"message"];
+ NSMutableDictionary *messageDictionary = [NSMutableDictionary dictionary];
+ [messageDictionary setObject:theMessage forKey:@"message"];
NSMutableDictionary *statusDictionary = [NSMutableDictionary dictionary];
- [statusDictionary setObject:messageDicationary forKey:@"status"];
+ [statusDictionary setObject:messageDictionary forKey:@"status"];
NSData *statusHTTPBody = [[self serializeDictionary:statusDictionary] dataUsingEncoding:NSUTF8StringEncoding];
@@ -349,10 +351,12 @@ - (BOOL)setStatus:(NSString *)theMessage
[client setHTTPMethod:@"PUT"];
[client setHTTPBody:statusHTTPBody];
[client setRequestHeaders:requestHeaders];
+ [client setOauthParamsLocation:@"OAUTH_PARAMS_IN_QUERY_STRING"];
YOSResponseData *response = [client sendSynchronousRequest];
NSInteger httpStatusCode = [response.HTTPURLResponse statusCode];
+ NSLog(@"%@", response.responseText);
// NSLog(@"%d", httpStatusCode);
[client release];
@@ -381,6 +385,7 @@ - (BOOL)setSmallViewWithContents:(NSString *)content
[client setHTTPMethod:@"PUT"];
[client setHTTPBody:smallViewContentHTTPBody];
[client setRequestHeaders:requestHeaders];
+ [client setOauthParamsLocation:@"OAUTH_PARAMS_IN_QUERY_STRING"];
YOSResponseData *response = [client sendSynchronousRequest];
NSInteger httpStatusCode = [response.HTTPURLResponse statusCode];

0 comments on commit 3163a53

Please sign in to comment.