parnurzeal / gorequest

GoRequest -- Simplified HTTP client ( inspired by nodejs SuperAgent )
http://parnurzeal.github.io/gorequest/
MIT License
3.44k stars 414 forks source link

Add possibility to use fieldname file (not change it to file1, file2,… #252

Closed macharmi closed 4 years ago

macharmi commented 4 years ago

Currenty, when we call SendFile(b, "file", "filename"), "file" will be changed to "file1", "file2", etc.. This is not good if we are dealing with a server that require a multipart with a fieldname equal to file.

I added an optional bool parameter skipFileNumbering in SendFile which disable adding those numbers

I am adding the possibility to skip appending numbers but without breaking compatibility or changing behavior of any existing code.