Skip to content

resp.Json()默认不传参,用法更符合requests #24

Description

@losenli

`func (resp *Response) Unmarshal(v interface{}) error {
if resp.content == nil {
resp.Content()
}
return json.Unmarshal(resp.content, v)
}

func (resp *Response) Json() (map[string]interface{}, error) {
var result = make(map[string]interface{})
if err := resp.Unmarshal(&result); err != nil {
return nil, err
}else {
return result, nil
}
}`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions