infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
18.18k stars 1.84k forks source link

[Bug]: {'data': None, 'retcode': 100, 'retmsg': "<MethodNotAllowed '405: Method Not Allowed'>"} #2499

Open Weishaoya opened 1 week ago

Weishaoya commented 1 week ago

Is there an existing issue for the same bug?

Branch name

main

Commit ID

the latest code

Other environment information

os: ubuntu 22.04
The ragflow was running by the source code.

Actual behavior

The official website documentation provides 8 API interfaces, of which I have been able to successfully invoke seven. However, there is one that I am unable to call successfully.

Expected behavior

How can I solve the problem? Thank you.

Steps to reproduce

import requests

doc_name = 'iFA信息系统0812_简.docx'
doc_id = '4b63b464764e11ef9e76d08e79175613'
# params = {'doc_name': doc_name}
params = {'doc_id': doc_id}
get_document_chunks_url = f'http://10.69.84.14:9222/v1/api/list_chunks'
get_document_chunks_response = requests.get(get_document_chunks_url, params=params, 
                                             headers={'Authorization':'Bearer ragflow-VkZTVlYWY2NzU4OTExZWY5Njc2ZDA4ZT'}).json()
print('='*100)
print('api接口: ', get_document_chunks_url, '\n', get_document_chunks_response)

output:
api接口:  http://10.69.84.14:9222/v1/api/list_chunks 
 {'data': None, 'retcode': 100, 'retmsg': "<MethodNotAllowed '405: Method Not Allowed'>"}

Additional information

No response

KevinHuSh commented 1 week ago

It's POST method.

Weishaoya commented 3 days ago

Thank you for KevinHuSh. For this api, your official documentation is written as the GET method.

KevinHuSh commented 3 days ago

Thank you for KevinHuSh. For this api, your official documentation is written as the GET method.

Could you file an issue?