Open suddenDisappear opened 1 year ago
if params.ct.jsonBody != "" { _, err = json.Marshal(params.ct.jsonBody) if err == nil { return str, rtnHeaders, &HttpCallerException{Message : "failed to bad content type json string", CauseErr : err} } reqStr = params.ct.jsonBody defaultContentType = params.ct.contentType; reqUrl = appendParams(reqUrl, data.Encode()) }
if params.ct.jsonBody != "" { _, err = json.Marshal(params.ct.jsonBody) if err == nil { return str, rtnHeaders, &HttpCallerException{Message : "failed to bad content type json string", CauseErr : err} } reqStr = params.ct.jsonBody defaultContentType = params.ct.contentType; reqUrl = appendParams(reqUrl, data.Encode()) }
这里的目标是判断是否是正确的json字符串吗?是否应该使用unmarshal和err != nil来进行快速失败