-
|
When i try to upload the gzip file it adds multiform header which breaks my gzip reader because of the Content-Type header curl -X 'POST' I need it to be application/gzip, is there any solution for this problem? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
The issue is actually in your go implementation. |
Beta Was this translation helpful? Give feedback.
-
|
I had to edit my code and add support for multipart, because i cant send request from swagger without it.
|
Beta Was this translation helpful? Give feedback.
-
|
If you want to use binary, you can use "octet-stream" for application/octet-stream. On the other hand, application/gzip can be added, but it won't say too much about the content type. |
Beta Was this translation helpful? Give feedback.
I had to edit my code and add support for multipart, because i cant send request from swagger without it.
if strings.HasPrefix(req.Header.Get("Content-Type"), "multipart/") { r, err = supportMultiParRequest(req) if err != nil { logger.LogError("Invalid JSON data", err) renderer.Renderer.Error(req, res, http.StatusInternalServerError, err.Error()) return } } else { r, err = gzip.NewReader(req.Body) if err != nil { logger.LogError("Invalid JSON data", err) renderer.Renderer.Error(req, res, http.StatusInternalServerError, err.Error()) return } }