Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchGet Query Parameters in Request Body (Using Generated Clients) #603

Open
jjoyce0510 opened this issue Apr 23, 2021 · 2 comments
Open

Comments

@jjoyce0510
Copy link

Hi there!

We are running into an issue where the BatchGet that we are issuing via Rest.li generated client classes BatchGetEntityRequestBuilderBase creates a URL that is too long. The Rest.li server rejects the request with 414 status code.

Is there a way to instruct the client to send the batch of ids in a POST body instead of a GET query string, as detailed here?
https://linkedin.github.io/rest.li/Send-Rest_li-Request-Query-In-Request-Body#request-without-body

If not, will this be implemented in the auto-generated clients?

Thanks,
John

@jjoyce0510
Copy link
Author

Any ideas here? You can see the associated issue in DataHub project above^

@karthikbalasub
Copy link
Contributor

@jjoyce0510 The recommended way to get query tunneling working is by using the r2 client. It is preconfigured to run the ClientQueryTunnelFilter, which would automatically do the conversion to send the long URI in request body.

If you cannot use the R2 client, then I suggest using the QueryTunnelUtil::encode api to convert the request generated.

I don't think we can update the generated client builders to do this conversion as it would conflict with the implementation in the R2 filter. Also, any encoding done on client side would require a parallel decoding on server side (r2 ensures this by adding the query tunnel filter both on client and server side), which would be missing in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants