Transfomr GET request to POST request with vector parameter

I try to connect with my server inside Quantconnet framework (https://www.quantconnect.com/). For some reason, they allow sending GET requests from their web framework (server) but not POST requests.

I would like to set up a proxy API in the middle, that accepts GET requests, and then transforms those into POST request as the final destination.

The problem is that, as I know, I can't send large vector of values (say of length 1000) in the body of GET requests, so it can't be followed to POST request?

In nutshell, my question is: Is it possible to make API endpoint that accepts GET requests and transform it to POST, but accepts vector of numbers as parameter?

Try sending multiple query parameters to your GET route. They will be upgraded to an array within plumber.

library(plumber)
pr() %>% 
  pr_get("/test", function(x) {str(x); x}) %>% 
  pr_run(port = 8000)
#> Running plumber API at http://127.0.0.1:8000
#> Running swagger Docs at http://127.0.0.1:8000/__docs__/
#>  chr [1:2] "1" "2"
$ curl "localhost:8000/test?x=1&x=2"
["1","2"]

You might be limited by the length of the url when using a GET request. From my experience it's about 6k characters.

I need much begger vector so I think that want work.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.