Add 'body' section for HTTP GET requests

After adding a new REST-API to the page; an HTTP GET request doesn’t contains a Body section (which does appear for POST / PUT requests)

I do understand why originally it’s not supported; but HTTP does support this kind of requests; and if an api that expect a Body shows up - there’s no option to sent this kind of request.

6 Likes

I’m in the same situation here!

2 Likes

me too! I desperately need this feature.

same here :frowning:

Is there any workaround to add a Body-section to a GET request?

Hey folks! This feature is actively being looked at by the dev team. I don't have an ETA to share with you but they've tried an implementation and are currently looking at working out some bugs with it.

@henning_dz it's possible to make fetch requests from JavaScript queries but they lack a lot of the infrastructure of REST resources so it might not work for you. Would you mind sharing a bit more about your use case?

Hey folks! We have an experimental feature flag to test supporting bodies on GET requests. If anybody on Cloud would like to try it please feel free to reach out to us directly!

Is there a way to do this using JS?

JavaScript queries do support fetch but since all JS is sandboxed it will come from a null origin which can cause CORS issues. You also lose various features, including built-in authentication methods, that come from using REST resource. Because of that, I'll usually recommend triggering a REST query as described in these docs.

Happy to turn on the flag for you so that you can try doing so! Otherwise, curious to hear more about your use case.

Has this still not been resolved? I'm seeing the same issue years later?

Hi @Jared_Eickelman!

GET requests should support bodies in version 2.121 and higher:

Would you mind sharing a screenshot of what you're seeing along with your version number?

Does JavaScript fetch with post method supported in retool?

Yep @Hocine_Hamdi! But as mentioned above, I'd still recommend triggering a separate REST query instead of using fetch directly in the script.