Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bitget-golang-sdk-api/internal/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func NewParams() map[string]string {
return make(map[string]string)
}

func NewParamsArrStr() map[string][]string {
return make(map[string][]string)
}

func ToJson(v interface{}) (string, error) {
result, err := json.Marshal(v)
if err != nil {
Expand Down
9 changes: 9 additions & 0 deletions bitget-golang-sdk-api/pkg/client/BitgetApiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ func (p *BitgetApiClient) Post(url string, params map[string]string) (string, er
return resp, err
}

func (p *BitgetApiClient) PostArr(url string, params map[string][]string) (string, error) {
postBody, jsonErr := internal.ToJson(params)
if jsonErr != nil {
return "", jsonErr
}
resp, err := p.BitgetRestClient.DoPost(url, postBody)
return resp, err
}

func (p *BitgetApiClient) Get(url string, params map[string]string) (string, error) {
resp, err := p.BitgetRestClient.DoGet(url, params)
return resp, err
Expand Down