| @@ -103,16 +103,21 @@ func httpRaw(httpMethod, targetURL string, data []byte, headers map[string]strin | |||
| } | |||
| defer r.Body.Close() | |||
| dump, err := httputil.DumpResponse(r, true) | |||
| if err != nil { | |||
| log.Fatal(err) | |||
| } | |||
| fmt.Printf("dump : %s", dump) | |||
| b, _ := ioutil.ReadAll(r.Body) | |||
| resp = string(b) | |||
| log.Println(resp) | |||
| if r.StatusCode != 200 { | |||
| debugDumpHTTPResponse(r) | |||
| err = errorHTTPResponseNew(r, r.Header.Get("X-Status-Reason")) | |||
| } | |||
| //log.Println(resp) | |||
| return | |||
| } | |||
| func debugDumpHTTPResponse(r *http.Response) { | |||
| dump, e := httputil.DumpResponse(r, true) | |||
| if e != nil { | |||
| log.Fatal(e) | |||
| } | |||
| fmt.Printf("dump : %s", dump) | |||
| } | |||