Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. data: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <error>
  3. <status>401</status>
  4. <timestamp>1349234286875</timestamp>
  5. <request-id>ZAAVLR7K6H</request-id>
  6. <error-code>0</error-code>
  7. <message>[unauthorized]. OAUxxxxxxxx-xxxxxxxx|*xx|*xx:xxxxxxxx:lxxxxxxxxxxxxxxxx=</message>
  8. </error>
  9.  
  10. http://api.linkedin.com/v1/people/~/shares
  11.  
  12. POST&http%3A%2F%2Fapi.linkedin.com%2Fv1%2Fpeople%2F~%2Fshares&oauth_consumer_key%3Diws9c2xtzgdr%26oauth_nonce%xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1349234713%26oauth_token%xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%26oauth_version%3D1.0
  13.  
  14. - (void) updateStatus : (NSString *) status{
  15. if (self.consumer != nil) {
  16. OAMutableURLRequest *request =
  17. [[OAMutableURLRequest alloc] initWithURL: requestURL
  18. consumer: self.consumer
  19. token: self.accessToken
  20. callback: nil
  21. signatureProvider: nil];
  22.  
  23. NSMutableDictionary *permsDict = [NSMutableDictionary dictionary];
  24.  
  25. [permsDict setValue: @"anyone" forKey: @"code"];
  26.  
  27. NSMutableDictionary *shareJSONDict = [NSMutableDictionary dictionary];
  28.  
  29. [shareJSONDict setValue: permsDict forKey: @"visibility"];
  30. [shareJSONDict setValue: @"test" forKey: @"comment"];
  31.  
  32. [request setValue:@"application/json" forHTTPHeaderField:@"x-li-format"];
  33.  
  34. NSString *updateString = [shareJSONDict JSONString];
  35.  
  36. [request setHTTPBodyWithString:updateString];
  37. [request setHTTPMethod:@"POST"];
  38.  
  39. OADataFetcher *fetcher = [[OADataFetcher alloc] init];
  40.  
  41. [fetcher fetchDataWithRequest: request
  42. delegate: self.sessionDelegate
  43. didFinishSelector: @selector(postUpdateApiCallResult:didFinish:)
  44. didFailSelector: @selector(postUpdateApiCallResult:didFail:)];
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement