function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bink wangbink wang 

SFRestMethodPOST returen null, anyone can help me??

the code bellow:
SFRestRequest *request = [SFRestRequest requestWithMethod:SFRestMethodPOST path:@"
/services/apexrest/MyRestApi/MyFavorite" queryParams:nil];
    request.endpoint = @"/services/apexrest/MyRestApi/MyFavorite";
    [[SFRestAPI sharedInstance] sendRESTRequest:request failBlock:^(NSError *e){
        NSLog(@"error: %@", e);
    } completeBlock:^(id success){
        NSLog(@"success: %@", success);
    }];
the response print in the console:
​success: (null)

anyone can tell me why?? thenks
 
Rajiv Bhatt 16Rajiv Bhatt 16
can you share the controller code in which you have exposed the REST API? Also, ideally you should first do a round of testing from developer workbench. 
Gaurav KheterpalGaurav Kheterpal
What does your endpiont return in case of successful invocation?

/services/apexrest/MyRestApi/MyFavorite

Does it have any data to be returned?