salesforce-marketingcloud / FuelSDK-Java

Salesforce Marketing Cloud Java SDK
BSD 3-Clause "New" or "Revised" License
72 stars 123 forks source link

[BUG] ETRestConnection , PATCH method not working #112

Open nagendra0506 opened 4 years ago

nagendra0506 commented 4 years ago

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

The bug has the severity

Additional context Add any other context about the problem here.