Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

405 Method Not Allowed #22656

Closed
lu-xiaoshuang opened this issue Jul 12, 2024 · 0 comments
Closed

405 Method Not Allowed #22656

lu-xiaoshuang opened this issue Jul 12, 2024 · 0 comments

Comments

@lu-xiaoshuang
Copy link

An error was occurred when I tried to query data with Trino Rest API.

Java Code:

        try {
            HttpPost httpPost = new HttpPost("http://address:port/v1/statement");
            httpPost.addHeader("X-Trino-Catalog", "mongodb");
            httpPost.addHeader("X-Trino-Schema", "database");
            StringEntity stringEntity = new StringEntity("select * from table;", ContentType.APPLICATION_JSON);
            httpPost.setEntity(stringEntity);
            CloseableHttpResponse closeableHttpResponse = closeableHttpClient.execute(httpPost);
            LOGGER.info("result: " + closeableHttpResponse);
        } catch (Exception e) {
            LOGGER.error("failed: ", e);
        }

Exception:

HTTP/1.1 405 Method Not Allowed

Trino Version:

449

Trino Config:

coordinator=true
# worker include coordinator
node-scheduler.include-coordinator=false
http-server.http.port=8000
discovery.uri=http://localhost:8000
@trinodb trinodb locked and limited conversation to collaborators Jul 12, 2024
@ebyhr ebyhr converted this issue into discussion #22658 Jul 12, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Development

No branches or pull requests

1 participant