HTTP方法' PATCH'不允许。允许使用POST,DELETE,GET,HEAD

时间:2018-06-02 07:48:39

标签: salesforce apex workbench

我创建了一种更新案例记录的方法。

@RestResource(urlMapping= '/FieldCases/*')
global with sharing class RestCaseController {
    @HttpPatch
    global static String caseUpdate(String caseId, String caseStatus, String caseNote){
        Case companyCase = [SELECT Id, Subject, Status, Description FROM Case WHERE Id = :caseId];

        companyCase.Status = caseStatus;
        companyCase.Description += caseNote;
        update companyCase;

        Return 'Updated';
    }
}

在工作台我正在使用

/服务/ apexrest / FieldCases

{"caseId" : "0037F00000bQYIjQAO",
 "caseStatus" : "Working",
 "caseNote" : "updating from the work bench"} 

但我收到以下错误

HTTP方法' PATCH'不允许。允许使用POST,DELETE,GET,HEAD

1 个答案:

答案 0 :(得分:0)

对我来说没问题。这是工作台中请求的屏幕截图:

enter image description here