React apps: rawRequest drops the request body on DELETE in backend functions

In a Retool React app backend function, calling a REST API resource with a body on DELETE sends the request with an empty body. POST with the same body works.

await upstockApi.rawRequest({
  path: 'admin/companies/link-buyer',
  method: 'DELETE',
  body: { supplierId, buyerId },
})

Our ASP.NET API binds [FromBody] on this endpoint, so it gets an empty body and returns 400 “A non-empty request body is required”. We tried three variations and all arrive empty:

  • bodyType: 'json' plus a Content-Type: application/json header, with an object body

  • bodyType: 'json' with a JSON.stringify(...) string body

  • bodyType: 'binary' with a base64 body

The same DELETE with a JSON body works from a classic app REST query. The TypeScript typings accept body on DELETE, so nothing warns you that it will be dropped.

Reproduced: in the published app, and with retool resource explore --environment staging.

Impact: any endpoint that takes a body on DELETE can’t be called from a React app. We’ve had to switch off three production admin actions.

Ask: send the body on DELETE the way classic queries do. Failing that, throw or warn when a body is passed on DELETE, so it doesn’t fail silently.

Summary

In a new (React-based) app builder backend function on Retool Cloud, calling a REST resource via rawRequest with a DELETE method sends an empty body (triggering a 400 on a [FromBody] endpoint), even though POST with the same body works and the identical DELETE-with-body succeeds from a classic app REST query.

AI Response

This lines up with a known class of regressions tied to Retool's ongoing replacement of the backend HTTP library, which has introduced gaps in how request bodies and headers are handled for certain methods. Retool staff have acknowledged this transition publicly and noted that some body/header behaviors still need to be addressed before the switch is complete. Since the same DELETE-with-body works from a classic app REST query, that path is a reliable fallback for the affected admin actions in the meantime. Separately, backend functions in the new React apps are known to not yet mirror every capability of classic queries when calling resources, so divergent behavior like this between the two builders is expected for now.

Sources

:bookmark: Raw request body behavior changed when Content-Type header is missing
A solved report where Retool staff confirm they're mid-transition replacing a problematic backend HTTP library, which caused request body/header handling changes and acknowledged feature gaps — the same root cause behind a DELETE body being dropped.
:bookmark: New React-based apps: no way to send per-request custom headers from a backend function to a GraphQL resource?
A solved thread corroborating that backend functions in the new React-based apps don't yet carry over all classic-query request capabilities when calling resources, explaining why this works in a classic query but not via rawRequest.

The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a :heart:, :+1:, or :-1:. Or by marking this post as the "Solution"! Let us know if you have any feedback here. :rocket:

Hi @DuncanRitchie,

Thanks for the really thorough write-up! The three variants and the repro made this easy to pin down, and I'm sorry it knocked out your admin actions.

A fix went out with Retool Cloud 4.75.0 recently after your post. rawRequest in React app backend functions now forwards the request body on DELETE (JSON, binary, and form-data), the same way classic REST queries do. Your original call should work as written:

await upstockApi.rawRequest({
  path: 'admin/companies/link-buyer',
  method: 'DELETE',
  body: { supplierId, buyerId },
})

Could you try re-enabling one of the admin actions and let me know if the body comes through? If anything still looks off, I'm happy to dig in further!

1 Like

Awesome thanks

I can confirm it is working now thanks

1 Like