Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func PostRequest(url string, request interface{}, t reflect.Type) (interface{}, error) {
- reflectObjectType := reflect.New(t)
- result := reflectObjectType.Interface()
- errBody := json.Unmarshal(body, &result)
- if errBody != nil {
- return nil, fmt.Errorf("Failed unmarshaling body to type object: %v", err)
- }
- }
Add Comment
Please, Sign In to add comment