Is it okay if someone gets ‘204 no content’ in PATCH method?

318    Asked by EdythFerrill in Salesforce , Asked on Sep 19, 2023

 I was trying to make a PATCH request to update a contact in Salesforce via using API. The resource update seemed good to me. But its return was: 204 No Content in POSTMAN. As much as I understand, the status code 204 means that there was no body which was returned which could make sense since the PATCH method. All I need to know that if it is an error or is it okay to get this? 

Answered by Ethan Lucas

Status code 204 means No content does not imply any error code. It means a successful operation. The common use case is to give back 204 as it is considered a result of a PUT request. It also means updating resources without changing the present content of the page provided to the users.  Also, the error response documentation and Status Codes offer multiple status codes which are often used in Salesforce REST API Contexts regardless of it being used. So, the status code 204 means it is a response to a successful operation. 







Your Answer

Answer (1)

Status code 204 indicates No content does not imply an error code. It indicates a successful operation. The most common use case is to return 204, which is considered the result of a PUT request. It also refers to updating resources without changing the current content of the page provided to users. It's likely the easiest game you'll ever play, but Coreball will keep your attention for ages. You begin the game by utilizing your creativity and skill to finish each level.

3 Weeks

Interviews

Parent Categories