I am trying to update SharePont search result page using Rest API. Trying to update property bag SRCH_x005f_SB_x005f_SET_x005f_SITE / SRCH_x005f_SB_x005f_SET_x005f_WEB however it returns 204 status code.
I need to use rest api only. Is there any solution to this?
Loading

Naimish MakwanaPosted Jul 9, 2024, 7:42 AM
The 204 status code you’re seeing is actually a success status. It means that the server successfully processed the request, but is not returning any content1. This is a common response from REST APIs when updating data2.
SharePoint REST API does not return the updated item/object after updating it. It only returns status code 204 if the update request is successful23. If you want to get the updated item/object, you have to make another GET request23.
Here’s an example of how you can do this in JavaScript:
In this example,
updateItemis used to update the item, and thengetItemis called within the success callback ofupdateItemto retrieve the updated item4. This way, you can see the updated item after a successful update. Please replace'YourListName'andYourItemIdwith your actual List Name and Item ID.Thanks