FuelSDK-Java icon indicating copy to clipboard operation
FuelSDK-Java copied to clipboard

[BUG] ETRestConnection , PATCH method not working

Open nagendra0506 opened this issue 4 years ago • 0 comments

Describe the bug Im trying to update the data extension records using ETRestConnection, PATCH method.

Its returning the method not support error because of request method type PATCH not supported by salesforce marketing cloud async rest API, it should be PUT.

To Reproduce try to use client.getRestConnection().patch method.

Expected behavior it should update the data extension records

Screenshots If applicable, add screenshots to help explain your problem.

Code snippet public Response patch(String path, String payload) throws ETSdkException { HttpURLConnection connection = null; try { Response response = new Response(); connection = sendRequest(path, Method.PATCH, payload); String json = receiveResponse(connection); response.setRequestId(connection.getHeaderField("X-Mashery-Message-ID")); response.setResponseCode(connection.getResponseCode()); response.setResponseMessage(connection.getResponseMessage()); response.setResponsePayload(json); return response; } catch (IOException ex) { throw new ETSdkException(ex); } finally { if (connection != null) { connection.disconnect(); } } }

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (e.g. gif) is not sufficient.

Environment

  • SDK Version [e.g. 1.1.0]
  • Java/ JDK version

The bug has the severity

  • [ ] Critical: The defect affects critical functionality or critical data. It does not have a workaround.
  • [ ] Major: The defect affects major functionality or major data. It has a workaround but is not obvious and is difficult.
  • [ ] Minor: The defect affects minor functionality or non-critical data. It has an easy workaround.
  • [ ] Trivial: The defect does not affect functionality or data. It does not even need a workaround. It does not impact productivity or efficiency. It is merely an inconvenience.

Additional context Add any other context about the problem here.

nagendra0506 avatar Dec 01 '19 18:12 nagendra0506