diff options
| author | Shulhan <ms@kilabit.info> | 2024-04-24 15:09:33 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-04-24 15:09:33 +0700 |
| commit | f5aa31cc48e78816d6eec75a03be4abdd7cb6649 (patch) | |
| tree | 8692e5e0b186407ec779b137397aa21fa81e790d /example.go | |
| parent | 9e7d6accdee5e0620bd9605d0cb225444671e1ce (diff) | |
| download | gorankusu-f5aa31cc48e78816d6eec75a03be4abdd7cb6649.tar.xz | |
all: refactoring form input for multipart form-data
This changes replace handling type for storing multipart form-data from
"map[string][]byte" to [*multipart.Form] based on changes on module
"pakakeh.go".
Diffstat (limited to 'example.go')
| -rw-r--r-- | example.go | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -554,19 +554,7 @@ func (ex *Example) pathExampleRawbodyJSON(epr *libhttp.EndpointRequest) (resbody } func (ex *Example) pathExampleUpload(epr *libhttp.EndpointRequest) (resb []byte, err error) { - var logp = `pathExampleUpload` - - var res = libhttp.EndpointResponse{} - - res.Code = http.StatusOK - res.Data = epr.HTTPRequest.MultipartForm.Value - - resb, err = json.MarshalIndent(res, ``, ` `) - if err != nil { - return nil, fmt.Errorf(`%s: %w`, logp, err) - } - - return resb, nil + return epr.RequestBody, nil } func (ex *Example) handleWSExampleGet(_ context.Context, req *websocket.Request) (res websocket.Response) { |
