Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom content type and data for multipart request #130

Closed
Asker80 opened this issue Feb 20, 2018 · 1 comment
Closed

custom content type and data for multipart request #130

Asker80 opened this issue Feb 20, 2018 · 1 comment
Assignees

Comments

@Asker80
Copy link
Contributor

Asker80 commented Feb 20, 2018

I'd like to raise the issue from #109 again. It was closed with content type autodetection, but there are still 2 problems with that: a) http.DetectContentType() does not detect every MIME type and b) SetFile() and SetFileReader() are written to deal specifically with files, and if you're trying to add some custom data with them, its rather awkward and limited. So instead of patching those functions like @gh0st42 did originally, I introduced a new type and supporting functions to solve the problem. Hope my suggestion is good enough to merge it, or at least build upon it. Here's the PR I made: #129.

PS: I'm writing a Go wrapper library for GLPI REST API and to upload a file it requires JSON encoded metadata as part of multipart request, that's the reason for this.
PPS: And finally let me say I really love Resty! Its awesome, powerful and easy to use.

@jeevatkm
Copy link
Member

@Asker80 PR is merged 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants