Skip to content

Commit

Permalink
新增header头
Browse files Browse the repository at this point in the history
  • Loading branch information
juxiaoming committed Sep 16, 2024
1 parent 3b31eb4 commit f5e0f48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions implement_baichuan.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ type BaiChuanChatResponse struct {

func (b *BaiChuanServer) Chat(requestPath string, data []byte) (*Response, error) {
ret := &Response{RequestData: data}
headers := map[string]string{"Authorization": "Bearer " + b.Conf.Key}
headers := map[string]string{"Authorization": "Bearer " + b.Conf.Key, "Content-Type": "application/json"}
response, err := postBase(requestPath, string(data), headers)
if err != nil {
return ret, err
Expand Down Expand Up @@ -182,7 +182,7 @@ type BaiChuanErrorInfo struct {
func (b *BaiChuanServer) ChatStream(requestPath string, data []byte, msgCh chan string, errChan chan error) (*Response, error) {
ret := &Response{RequestData: data, ResponseData: make([]byte, 0)}

headers := map[string]string{"Authorization": "Bearer " + b.Conf.Key}
headers := map[string]string{"Authorization": "Bearer " + b.Conf.Key, "Content-Type": "application/json"}
response, err := postBase(requestPath, string(data), headers)
if err != nil {
errChan <- err
Expand Down

0 comments on commit f5e0f48

Please sign in to comment.