MCPcopy Create free account
hub / github.com/aws/smithy-go / NewEncoderWithRawPath

Function NewEncoderWithRawPath

encoding/httpbinding/encode.go:39–53  ·  view source on GitHub ↗

NewHTTPBindingEncoder creates a new encoder from the passed in request. All query and header values will be added on top of the request's existing values. Overwriting duplicate values.

(path, rawPath, query string, headers http.Header)

Source from the content-addressed store, hash-verified

37// header values will be added on top of the request's existing values. Overwriting
38// duplicate values.
39func NewEncoderWithRawPath(path, rawPath, query string, headers http.Header) (*Encoder, error) {
40 parseQuery, err := url.ParseQuery(query)
41 if err != nil {
42 return nil, fmt.Errorf("failed to parse query string: %w", err)
43 }
44
45 e := &Encoder{
46 path: []byte(path),
47 rawPath: []byte(rawPath),
48 query: parseQuery,
49 header: headers.Clone(),
50 }
51
52 return e, nil
53}
54
55// Encode returns a REST protocol encoder for encoding HTTP bindings.
56//

Callers 1

NewEncoderFunction · 0.85

Calls 2

ErrorfMethod · 0.80
CloneMethod · 0.45

Tested by

no test coverage detected