ragflow http请求 header处理
This commit is contained in:
@@ -74,6 +74,7 @@ func doRequest(ctx context.Context, method string, url string, headers map[strin
|
|||||||
defer response.Close()
|
defer response.Close()
|
||||||
result := response.ReadAll()
|
result := response.ReadAll()
|
||||||
resultStrut := &ghttp.DefaultHandlerResponse{}
|
resultStrut := &ghttp.DefaultHandlerResponse{}
|
||||||
|
|
||||||
gconv.Struct(result, &resultStrut)
|
gconv.Struct(result, &resultStrut)
|
||||||
if resultStrut.Code == 200 || resultStrut.Code == 0 {
|
if resultStrut.Code == 200 || resultStrut.Code == 0 {
|
||||||
gconv.Struct(resultStrut.Data, target)
|
gconv.Struct(resultStrut.Data, target)
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ func (c *Client) request(ctx context.Context, method, path string, body interfac
|
|||||||
if endpoint == "" {
|
if endpoint == "" {
|
||||||
return gerror.New("RAGFlow endpoints not configured")
|
return gerror.New("RAGFlow endpoints not configured")
|
||||||
}
|
}
|
||||||
|
|
||||||
fullURL := endpoint + path
|
fullURL := endpoint + path
|
||||||
|
|
||||||
// 添加详细日志:请求信息
|
// 添加详细日志:请求信息
|
||||||
|
|||||||
Reference in New Issue
Block a user