func (h *HttpClient) convert(r *Request, content string) error { um, _ := encoding.NewEncoder(encoding.JSON) if r.encodingType != 0 { um, _ = encoding.NewEncoder(r.encodingType) } um.UnMarshalStr(content, r.result) return nil }
func (h *HttpClient) convertBody(data interface{}) string { if data == nil { return "" } encoder, _ := encoding.NewEncoder(encoding.JSON) body, _ := encoder.Marshal(data) return body }
func printEncodedType(formatter cli.Formatter, encoder encoding.EncoderType) { e, _ := encoding.NewEncoder(encoder) str, _ := e.MarshalIndent(formatter) fmt.Println(str) }