From f5aa31cc48e78816d6eec75a03be4abdd7cb6649 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Wed, 24 Apr 2024 15:09:33 +0700 Subject: 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". --- example.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'example.go') diff --git a/example.go b/example.go index c17aab9..00ec3a9 100644 --- a/example.go +++ b/example.go @@ -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) { -- cgit v1.3