Comments (1)
Thank you. Have you had a look at the MediaWiki API docs for uploading files? https://www.mediawiki.org/wiki/API:Upload I think the Post
method would work fine for making upload requests. The only caveat is that file uploads must be sent as multipart/form-data
and go-mwclient only uses that format for requests with sufficiently large (>8K) fields. If you try to upload an image smaller than that, it would try to send the request as application/x-www-form-urlencoded
. Perhaps working around this issue would be a good reason to add a special method for uploading files to go-mwclient. Alternatively, I could change it to always use multipart/form-data
for POST requests. I don't see any downsides to doing that. Still, it could be useful to have a method like Upload(params params.Values, file io.Reader) error
as a convenience.
from go-mwclient.
Related Issues (10)
- The tests are lousy HOT 1
- Support multipart/form-data for large edits HOT 4
- Cannot login on wiki.piratenpartei.de HOT 1
- go-mwclient login fails when wiki is private
- Hide url.Values ugliness HOT 1
- action=login" is deprecated and may stop working without warning. HOT 1
- Replace go-simplejson with jason HOT 2
- Version 1.0 HOT 2
- GetPage(s) functions treat warnings as errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-mwclient.