MCPcopy Index your code
hub / github.com/dnote/dnote / parseRequestData

Function parseRequestData

pkg/server/controllers/helpers.go:34–51  ·  view source on GitHub ↗
(r *http.Request, dst interface{})

Source from the content-addressed store, hash-verified

32)
33
34func parseRequestData(r *http.Request, dst interface{}) error {
35 ct := r.Header.Get("Content-Type")
36
37 if ct == consts.ContentTypeForm {
38 if err := parseForm(r, dst); err != nil {
39 return errors.Wrap(err, "parsing form")
40 }
41
42 return nil
43 }
44
45 // default to JSON
46 if err := parseJSON(r, dst); err != nil {
47 return errors.Wrap(err, "parsing JSON")
48 }
49
50 return nil
51}
52
53func parseForm(r *http.Request, dst interface{}) error {
54 if err := r.ParseForm(); err != nil {

Callers 8

createMethod · 0.85
updateMethod · 0.85
createMethod · 0.85
updateMethod · 0.85
LoginMethod · 0.85
V3LoginMethod · 0.85
PasswordUpdateMethod · 0.85
ProfileUpdateMethod · 0.85

Calls 2

parseFormFunction · 0.85
parseJSONFunction · 0.85

Tested by

no test coverage detected