|
- package remoteUtil
-
- import (
- "github.com/go-resty/resty/v2"
- )
-
- type EvidenceParam struct {
- Url string `json:"url"`
- Type string `json:"type"`
- MemberName string `json:"memberName"`
- ContractAddress string `json:"contractAddress"`
- FunctionName string `json:"functionName"`
- Args []string `json:"args"`
- Token string `json:"token"`
- }
-
- func Evidence(EvidenceParam EvidenceParam) error {
- httpClient := resty.New().R()
- _, err := httpClient.SetHeader("Content-Type", "application/json").
- SetHeader("Authorization", EvidenceParam.Token).
- SetBody(&EvidenceParam.Args).
- Post(EvidenceParam.Url)
- if err != nil {
- return err
- }
- return nil
- }
|