https://www.volcengine.com/docs/4640/65066
请将该请求表述为 curl
package main import ( "fmt" "net/http" "net/url" "time" "github.com/volcengine/volc-sdk-golang/base" ) const ( kAccessKey = {密钥管理中的 AccessKey ID} kSecretKey = {密钥管理中的 AccessKey Secret} kServiceVersion = "2020-06-01" ) var ( ServiceInfo = &base.ServiceInfo{ Timeout: 5 * time.Second, Host: "open.volcengineapi.com", Header: http.Header{ "Accept": []string{"application/json"}, }, Credentials: base.Credentials{Region: base.RegionCnNorth1, Service: "translate"}, } ApiInfoList = map[string]*base.ApiInfo{ "LangDetect": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"LangDetect"}, "Version": []string{kServiceVersion}, }, }, } ) func newClient() *base.Client { client := base.NewClient(ServiceInfo, ApiInfoList) client.SetAccessKey(kAccessKey) client.SetSecretKey(kSecretKey) return client } func main() { client := newClient() resp, code, err := client.Json("LangDetect", nil, `{"TextList":["你好世界"]}`) if err != nil { panic(err) } fmt.Printf("%d %s\n", code, string(resp)) }