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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans