Skip to main content
Solved

How to Restful delete method works?

  • November 15, 2022
  • 2 replies
  • 625 views

hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Superhero (Customer)

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.

 

Best answer by Technical Outlaws

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"

View original
Did this topic help you find an answer to your question?

Technical Outlaws
Hero (Employee)
Forum|alt.badge.img+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"


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Superhero (Customer)
  • November 16, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings