Solved

How to Restful delete method works?

  • 15 November 2022
  • 2 replies
  • 375 views

Userlevel 5
Badge +14
  • Hero (Customer)
  • 275 replies

I am practicing on Restful Apis. I can use Get and Post methods. However, I couldn’t use the Delete method. I added the If-Match parameter to the header. I tried “*” as the value, I tried with etag value. I couldn’t solve the problem. The error message is “ORA-20100: Error.ODATA_TO_PLSQL_PROTOCOL: ETag must have a valid value, was [*]” How can I delete a record?

 

Example

Projection: main/ifsapplications/projection/v1/EmployeesHandling.svc

 

I can Post gender.

I can Get the gender.

I can’t Delete the gender.

 

icon

Best answer by Technical Outlaws 16 November 2022, 12:24

View original

2 replies

Userlevel 5
Badge +11

For the etag, make sure you remove the \ character in the actual string, as this is used to handle the “ in JSON.

 

For example, take the following etag from a Get request.

"@odata.etag": "W/\"Vy8iOTBDODc5RTQ4NzkxNDZCQkIyRkU5RTQ3M0U3RUU2NUI6MjAyMDA2MjUwOTA3MTQi\""

 

The actual etag string to use in the If-Match header parameter.

W/"Vy8iOTBDODc5RTQ4NzkxNDZCQkIyRkU5RTQ3M0U3RUU2NUI6MjAyMDA2MjUwOTA3MTQi"

Userlevel 5
Badge +14

That is perfect. Very smartly. Thank you @Technical Outlaws . I wasn’t thinking of “\” as an escape character. Is it written in the technical documentation? 

 

Reply