web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

PATCH request failed for CRM REST API

(0) ShareShare
ReportReport
Posted on by

I am updating the case record partially through CRM API with PATCH request. While doing in postman, its successfully updated. But from the code, I am getting exception as below.

"exceptionStacktrace": "java.lang.RuntimeException: java.lang.RuntimeException: java.net.ProtocolException: Invalid HTTP method: PATCH\n\tat com.spr.crm.apiClient.dynamics.DynamicsApiClientImpl.updateEntity(DynamicsApiClientImpl.java:111)\n\tat com.spr.crm.handler.clients.DynamicsCRMClient.updateDynamicsCase(DynamicsCRMClient.java:560)\n\tat com.spr.crm.handler.clients.DynamicsCRMClient.handleCaseUpdated(DynamicsCRMClient.java:112)\n\tat com.spr.common.WebhookType$2.handleWebhook(WebhookType.java:62)\n\tat com.spr.crm.handler.CrmSinkHandlerImpl.handle(CrmSinkHandlerImpl.java:41)\n\tat com.spr.crm.executor.tasks.CrmWebhookTask.doRun(CrmWebhookTask.java:37)\n\tat com.spr.common.tasks.AbstractTask.run(AbstractTask.java:73)\n\tat com.spr.executor.CommonPartitionedTaskExecutor.lambda$initializeConsumer$0(CommonPartitionedTaskExecutor.java:91)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: java.lang.RuntimeException: java.net.ProtocolException: Invalid HTTP method: PATCH\n\tat com.spr.crm.apiClient.dynamics.DynamicsApiClientImpl.makeCall(DynamicsApiClientImpl.java:150)\n\tat com.spr.crm.apiClient.dynamics.DynamicsApiClientImpl.updateEntity(DynamicsApiClientImpl.java:104)\n\t... 8 more\nCaused by: java.net.ProtocolException: Invalid HTTP method: PATCH\n\tat java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:440)\n\tat sun.net.www.protocol.http.HttpURLConnection.setRequestMethod(HttpURLConnection.java:553)\n\tat sun.net.www.protocol.https.HttpsURLConnectionImpl.setRequestMethod(HttpsURLConnectionImpl.java:388)\n\tat com.spr.crm.apiClient.http.HttpExecutorImpl.doRequest(HttpExecutorImpl.java:215)\n\tat com.spr.crm.apiClient.http.HttpExecutorImpl.requestViaProxyIncludeHeaders(HttpExecutorImpl.java:114)\n\tat com.spr.crm.apiClient.dynamics.DynamicsApiClientImpl.lambda$updateEntity$2(DynamicsApiClientImpl.java:105)\n\tat com.spr.crm.apiClient.dynamics.DynamicsApiClientImpl.makeCall(DynamicsApiClientImpl.java:147)\n\t... 9 more\n"

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    This issue is only appearing for PATCH request? 

    Also, please check below link you might find some info.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 184 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 125

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans