Closed AtomicTroop closed 1 year ago
Hi, @AtomicTroop , could you show me how you encoded the branch name?
I tried this database dolthub/transparency-in-pricing using the branch spacelove/docs-coy-mink
, the branch name is encoded into spacelove%2Fdocs-coy-mink
.
The following link seems to be working for me:
https://www.dolthub.com/api/v1alpha1/dolthub/transparency-in-pricing/spacelove%2Fdocs-coy-mink?q=show%20tables;
Hi again, thanks for the response, I went back to sanity check and indeed, while the encoded uri did work I had missed encoding one successive request further down the serverside function resulting in the 404 not found error.
So TL;DR, chalk this one up to user error. Closing this one now as everything seems to be working fine after all.
When using the DoltHub SQL API to operate on a branch with a slash in its name (like the automatically named pull request branches created by the web UI Spreadsheet Editor), URI encoding the slash should correctly let me target the branch. Instead, the request fails with error 404.
Steps to reproduce the behavior:
https://www.dolthub.com/api/v1alpha1/<owner>/<db>/<encoded-branch-name>/<query>
Tested on:
This issue should of course be device-agnostic considering it's an API issue but test device and browser was included for completeness' sake. I haven't tested if the issue also exists with the CSV API but it's worth checking.
The Database API seems to pass the branch name in the request body which probably circumvents the issue. I would assume the branch name does not need to be encoded when sent as part of the request body.