zymap commented on a change in pull request #5376: [Issue 3009][docs] Add presto sql REST APIs doc URL: https://github.com/apache/pulsar/pull/5376#discussion_r351082663
########## File path: site2/docs/sql-rest-api.md ########## @@ -0,0 +1,196 @@ +--- +id: sql-rest-api +title: Pulsar SQL REST APIs +sidebar_label: REST APIs +--- + +## Overview + +This describes the resources that make up the Presto REST API v1. If you have any problems or request, please create a Github issue to contact us. + +## Current version + +All requests should use the v1 version of REST API to request the presto service. You need to use explicitly URL `http://presto.service:8081/v1` to request service. + +Also, the header `X-Presto-User` is required when you send a `POST` request. + +```properties +X-Presto-User: username +``` + +For more information about headers, see the [presto/PrestoHeaders.java at master · prestodb/presto · GitHub](https://github.com/prestodb/presto/blob/master/presto-client/src/main/java/com/facebook/presto/client/PrestoHeaders.java) + +## Schema + +You can type statement in the HTTP body. And all data is received as JSON that might contain a `nextUri` link. If there is no `nextUri` link, then the query is finished (either successfully completed or failed). Otherwise., keep following the `nextUri` link. + +**Example**: Execute `show catalogs`. + +```powershell +➜ ~ curl --header "X-Presto-User: test-user" --request POST --data 'show catalogs' http://localhost:8081/v1/statement | json_pp Review comment: It's a JSON format util. Already remove it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
