first push
This commit is contained in:
parent
8fe8d3f716
commit
c0397c568e
|
@ -22,6 +22,7 @@ type Request struct {
|
||||||
Files map[string]string `json:"files"` // todo 处理 Files
|
Files map[string]string `json:"files"` // todo 处理 Files
|
||||||
Raw string `json:"raw"` // 原始请求数据
|
Raw string `json:"raw"` // 原始请求数据
|
||||||
JsonByte []byte `json:"json_raw"` // JSON格式请求数据 todo 多层 嵌套
|
JsonByte []byte `json:"json_raw"` // JSON格式请求数据 todo 多层 嵌套
|
||||||
|
Xml []byte `json:"xml"` // xml
|
||||||
}
|
}
|
||||||
|
|
||||||
// 响应结构体
|
// 响应结构体
|
||||||
|
@ -84,6 +85,11 @@ func (r *Request) getData() io.Reader {
|
||||||
if _, ex := r.Headers["Content-Type"]; !ex {
|
if _, ex := r.Headers["Content-Type"]; !ex {
|
||||||
r.Headers["Content-Type"] = "application/json"
|
r.Headers["Content-Type"] = "application/json"
|
||||||
}
|
}
|
||||||
|
} else if r.Xml != nil {
|
||||||
|
reqBody = string(r.Xml)
|
||||||
|
if _, ex := r.Headers["Content-Type"]; !ex {
|
||||||
|
r.Headers["Content-Type"] = "application/xml"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return strings.NewReader(reqBody)
|
return strings.NewReader(reqBody)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue