MCPcopy
hub / github.com/httprunner/httprunner / convertCompatRequestBody

Function convertCompatRequestBody

hrp/testcase.go:292–306  ·  view source on GitHub ↗
(request *Request)

Source from the content-addressed store, hash-verified

290}
291
292func convertCompatRequestBody(request *Request) {
293 if request != nil && request.Body == nil {
294 if request.Json != nil {
295 if request.Headers == nil {
296 request.Headers = make(map[string]string)
297 }
298 request.Headers["Content-Type"] = "application/json; charset=utf-8"
299 request.Body = request.Json
300 request.Json = nil
301 } else if request.Data != nil {
302 request.Body = request.Data
303 request.Data = nil
304 }
305 }
306}
307
308func convertCompatValidator(Validators []interface{}) (err error) {
309 for i, iValidator := range Validators {

Callers 2

MakeCompatMethod · 0.85
ToAPIMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected