Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions WordPressKit/BlogServiceRemoteREST.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (void)getAllAuthorsWithRemoteUsers:(NSMutableArray <RemoteUser *>*)remoteUsers
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -138,7 +138,7 @@ - (void)syncPostTypesWithSuccess:(PostTypesHandler)success
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
NSDictionary *parameters = @{@"context": @"edit"};
[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:parameters
success:^(NSDictionary *responseObject, NSHTTPURLResponse *httpResponse) {

Expand Down Expand Up @@ -168,7 +168,7 @@ - (void)syncPostFormatsWithSuccess:(PostFormatsHandler)success
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
NSDictionary *formats = [self mapPostFormatsFromResponse:responseObject[@"formats"]];
Expand All @@ -189,7 +189,7 @@ - (void)syncBlogWithSuccess:(BlogDetailsHandler)success
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
NSDictionary *responseDict = (NSDictionary *)responseObject;
Expand All @@ -210,7 +210,7 @@ - (void)syncBlogSettingsWithSuccess:(SettingsHandler)success
NSString *path = [self pathForSettings];
NSString *requestUrl = [self pathForEndpoint:path withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (![responseObject isKindOfClass:[NSDictionary class]]){
Expand Down Expand Up @@ -240,7 +240,7 @@ - (void)updateBlogSettings:(RemoteBlogSettings *)settings
NSString *path = [NSString stringWithFormat:@"sites/%@/settings?context=edit", self.siteID];
NSString *requestUrl = [self pathForEndpoint:path withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(NSDictionary *responseDict, NSHTTPURLResponse *httpResponse) {
if (![responseDict isKindOfClass:[NSDictionary class]]) {
Expand Down Expand Up @@ -272,7 +272,7 @@ - (void)fetchSiteInfoForAddress:(NSString *)siteAddress
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand All @@ -293,7 +293,7 @@ - (void)fetchUnauthenticatedSiteInfoForAddress:(NSString *)siteAddress
NSString *path = [self pathForEndpoint:@"connect/site-info" withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
NSURL *siteURL = [NSURL URLWithString:siteAddress];

[self.wordPressComRestApi GET:path
[self.wordPressComRESTAPI get:path
parameters:@{ @"url": siteURL.absoluteString }
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down
30 changes: 15 additions & 15 deletions WordPressKit/CommentServiceRemoteREST.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)getCommentsWithMaximumCount:(NSInteger)maximumComments
[parameters removeObjectForKey:@"status"];
parameters[@"status"] = [self parameterForCommentStatus:statusFilter];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -84,7 +84,7 @@ - (void)getCommentWithID:(NSNumber *)commentID
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
RemoteComment *comment = [self remoteCommentFromJSONDictionary:responseObject];
Expand Down Expand Up @@ -116,7 +116,7 @@ - (void)createComment:(RemoteComment *)comment
@"content": comment.content,
@"context": @"edit",
};
[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
// TODO: validate response
Expand Down Expand Up @@ -147,7 +147,7 @@ - (void)updateComment:(RemoteComment *)comment
@"context": @"edit",
};

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
// TODO: validate response
Expand All @@ -174,7 +174,7 @@ - (void)moderateComment:(RemoteComment *)comment
@"status": [self remoteStatusWithStatus:comment.status],
@"context": @"edit",
};
[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
// TODO: validate response
Expand All @@ -197,7 +197,7 @@ - (void)trashComment:(RemoteComment *)comment
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -226,7 +226,7 @@ - (void)syncHierarchicalCommentsForPost:(NSNumber *)postID
NSDictionary *parameters = @{
@"force": @"wpcom" // Force fetching data from shadow site on Jetpack sites
};
[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -258,7 +258,7 @@ - (void)updateCommentWithID:(NSNumber *)commentID
@"content": content,
@"context": @"edit",
};
[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand All @@ -282,7 +282,7 @@ - (void)replyToPostWithID:(NSNumber *)postID

NSDictionary *parameters = @{@"content": content};

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -310,7 +310,7 @@ - (void)replyToCommentWithID:(NSNumber *)commentID
@"content": content,
@"context": @"edit",
};
[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -339,7 +339,7 @@ - (void)moderateCommentWithID:(NSNumber *)commentID
@"context" : @"edit",
};

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand All @@ -360,7 +360,7 @@ - (void)trashCommentWithID:(NSNumber *)commentID
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand All @@ -381,7 +381,7 @@ - (void)likeCommentWithID:(NSNumber *)commentID
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand All @@ -402,7 +402,7 @@ - (void)unlikeCommentWithID:(NSNumber *)commentID
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down Expand Up @@ -444,7 +444,7 @@ - (void)getLikesForCommentID:(NSNumber *)commentID
parameters[@"exclude"] = excludeUserIDs;
}

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
if (success) {
Expand Down
14 changes: 7 additions & 7 deletions WordPressKit/MediaServiceRemoteREST.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ - (void)getMediaWithID:(NSNumber *)mediaID

NSDictionary * parameters = @{};

[self.wordPressComRestApi GET:requestUrl parameters:parameters success:^(id responseObject, NSHTTPURLResponse *response) {
[self.wordPressComRESTAPI get:requestUrl parameters:parameters success:^(id responseObject, NSHTTPURLResponse *response) {
if (success) {
NSDictionary *response = (NSDictionary *)responseObject;
success([MediaServiceRemoteREST remoteMediaFromJSONDictionary:response]);
Expand Down Expand Up @@ -60,7 +60,7 @@ - (void)getMediaLibraryPage:(NSString *)pageHandle
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:[NSDictionary dictionaryWithDictionary:parameters]
success:^(id responseObject, NSHTTPURLResponse *response) {
NSArray *mediaItems = responseObject[@"media"];
Expand Down Expand Up @@ -104,7 +104,7 @@ - (void)getMediaLibraryCountForType:(NSString *)mediaType
parameters[@"mime_type"] = mediaType;
}

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:[NSDictionary dictionaryWithDictionary:parameters]
success:^(id responseObject, NSHTTPURLResponse *response) {
NSDictionary *jsonDictionary = (NSDictionary *)responseObject;
Expand Down Expand Up @@ -261,7 +261,7 @@ - (void)updateMedia:(RemoteMedia *)media

NSDictionary *parameters = [self parametersFromRemoteMedia:media];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:parameters
success:^(id responseObject, NSHTTPURLResponse *response) {
RemoteMedia *media = [MediaServiceRemoteREST remoteMediaFromJSONDictionary:responseObject];
Expand All @@ -285,7 +285,7 @@ - (void)deleteMedia:(RemoteMedia *)media
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
NSDictionary *response = (NSDictionary *)responseObject;
Expand Down Expand Up @@ -318,7 +318,7 @@ -(void)getMetadataFromVideoPressID:(NSString *)videoPressID
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestUrl
[self.wordPressComRESTAPI get:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
NSDictionary *response = (NSDictionary *)responseObject;
Expand Down Expand Up @@ -358,7 +358,7 @@ -(void)getVideoPressToken:(NSString *)videoPressID
NSString *requestUrl = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_2_0];

[self.wordPressComRestApi POST:requestUrl
[self.wordPressComRESTAPI post:requestUrl
parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
NSDictionary *response = (NSDictionary *)responseObject;
Expand Down
8 changes: 4 additions & 4 deletions WordPressKit/MenusServiceRemote.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)createMenuWithName:(NSString *)menuName
NSString *requestURL = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi POST:requestURL
[self.wordPressComRESTAPI post:requestURL
parameters:@{MenusRemoteKeyName: menuName}
success:^(id _Nonnull responseObject, NSHTTPURLResponse *httpResponse) {
void(^responseFailure)(void) = ^() {
Expand Down Expand Up @@ -94,7 +94,7 @@ - (void)updateMenuForID:(NSNumber *)menuID
// Brent Coursey - 10/1/2015
[params setObject:menuID forKey:MenusRemoteKeyID];

[self.wordPressComRestApi POST:requestURL
[self.wordPressComRESTAPI post:requestURL
parameters:params
success:^(id _Nonnull responseObject, NSHTTPURLResponse *httpResponse) {
void(^responseFailure)(void) = ^() {
Expand Down Expand Up @@ -131,7 +131,7 @@ - (void)deleteMenuForID:(NSNumber *)menuID
NSString *path = [NSString stringWithFormat:@"sites/%@/menus/%@/delete", siteID, menuID];
NSString *requestURL = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
[self.wordPressComRestApi POST:requestURL
[self.wordPressComRESTAPI post:requestURL
parameters:nil
success:^(id _Nonnull responseObject, NSHTTPURLResponse *httpResponse) {
void(^responseFailure)(void) = ^() {
Expand Down Expand Up @@ -169,7 +169,7 @@ - (void)getMenusForSiteID:(NSNumber *)siteID
NSString *requestURL = [self pathForEndpoint:path
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];

[self.wordPressComRestApi GET:requestURL
[self.wordPressComRESTAPI get:requestURL
parameters:nil
success:^(id _Nonnull responseObject, NSHTTPURLResponse *httpResponse) {
if (![responseObject isKindOfClass:[NSDictionary class]]) {
Expand Down
Loading