Just
Just copied to clipboard
multipart / form-data
How to send ( post ) multipart / form-data? only string data ... not files ... Thanks ...
You can use the text option of files.
Just.post("url", files: [.text(YOUR_TEXT, "filename", nil)])
if let requestData = requestBody { body = requestData } else if files.count > 0 { body = synthesizeMultipartBody(data, files: files) let bound = self.defaults.multipartBoundary contentType = "multipart/form-data; boundary=(bound)"
.etc ...
This piece of code is not good - because it assumes that the "multipart" (as a string only) can not be a parameter. The specification says it can. Content-Type: multipart / form-data; boundary = Aaxxxxx Content-Disposition: form-data; name = "years" (no filename parameter) 20 - THIS IS VALUE I changed the part of the code for my needs