Permalink
Browse files

SimplenoteEntryCollector now sets post data content type to "applicat…

…ion/json" when sending JSON.
  • Loading branch information...
1 parent 47f8452 commit 3c7aff9da1cd9ba89d99eeb74a79d4933eeabef4 @darrylhthomas darrylhthomas committed May 18, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 SimplenoteEntryCollector.m
@@ -283,7 +283,7 @@ - (SyncResponseFetcher*)_fetcherForNote:(NoteObject*)aNote creator:(BOOL)doesCre
} else {
noteURL = [SimplenoteSession servletURLWithPath:[NSString stringWithFormat:@"/api2/data/%@", [info objectForKey:@"key"]] parameters:params];
}
- SyncResponseFetcher *fetcher = [[SyncResponseFetcher alloc] initWithURL:noteURL POSTData:[[rawObject jsonStringValue] dataUsingEncoding:NSUTF8StringEncoding] delegate:self];
+ SyncResponseFetcher *fetcher = [[SyncResponseFetcher alloc] initWithURL:noteURL POSTData:[[rawObject jsonStringValue] dataUsingEncoding:NSUTF8StringEncoding] contentType:@"application/json" delegate:self];
[fetcher setRepresentedObject:aNote];
return [fetcher autorelease];
}
@@ -316,7 +316,7 @@ - (SyncResponseFetcher*)fetcherForDeletingNote:(DeletedNoteObject*)aDeletedNote
[NSDictionary dictionaryWithObjectsAndKeys: email, @"email",
authToken, @"auth", nil]];
NSData *postData = [[[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:1] forKey:@"deleted"] jsonStringValue] dataUsingEncoding:NSUTF8StringEncoding];
- SyncResponseFetcher *fetcher = [[SyncResponseFetcher alloc] initWithURL:noteURL POSTData:postData delegate:self];
+ SyncResponseFetcher *fetcher = [[SyncResponseFetcher alloc] initWithURL:noteURL POSTData:postData contentType:@"application/json" delegate:self];
[fetcher setRepresentedObject:aDeletedNote];
return [fetcher autorelease];

0 comments on commit 3c7aff9

Please sign in to comment.