MCPcopy Create free account
hub / github.com/imroc/req / SetContentType

Method SetContentType

request.go:963–965  ·  view source on GitHub ↗

SetContentType set the `Content-Type` for the request.

(contentType string)

Source from the content-addressed store, hash-verified

961
962// SetContentType set the `Content-Type` for the request.
963func (r *Request) SetContentType(contentType string) *Request {
964 return r.SetHeader(header.ContentType, contentType)
965}
966
967// Context method returns the Context if its already set in request
968// otherwise it creates new one using `context.Background()`.

Callers 9

SetBodyJsonBytesMethod · 0.95
SetBodyXmlBytesMethod · 0.95
handleMultiPartFunction · 0.80
handleFormDataFunction · 0.80
handleOrderedFormDataFunction · 0.80
parseRequestBodyFunction · 0.80
SetContentTypeFunction · 0.80
TestSetBodyMarshalFunction · 0.80

Calls 1

SetHeaderMethod · 0.95

Tested by 2

TestSetBodyMarshalFunction · 0.64