DELETE endpoint overrides response.content or message.content not working for me

Hi, is there a trick im missing on response operations ? (ive been able to transform responses all the time but this case might be different)

the case:

1. my backend is a DELETE endpoint that responds a 204 for success and responds no content. (no message no json, empty)

2. In the response area, I do my usua response transformation where I identify the no content case.

in that case in JS i did

context.setVariable("response.content",JSON.stringify(myResponse));

3. I see in the trace the data I sent in myResponse. but the client in postman still gets 204 and empty data.

4. I thought. maybe this is a bug and I really need to do the Add Message policy

so I did as well affecting the message.content

I can see both approaches working in the trace, but postman still receives the same response as the backend : 204 empty

any thought?

Solved Solved
0 2 257
1 ACCEPTED SOLUTION

when you set the response.content,

are you also setting the response.status.code ?

204 = No Content

It's possible that because the status code is 204, Apigee Edge is ignoring whatever you put into response.content. I suppose you'd want a 200 if you are returning a message body.

View solution in original post

2 REPLIES 2

when you set the response.content,

are you also setting the response.status.code ?

204 = No Content

It's possible that because the status code is 204, Apigee Edge is ignoring whatever you put into response.content. I suppose you'd want a 200 if you are returning a message body.

very great idea! ill try out at some point today