Improvement to file uploading

This commit is contained in:
Ivan Paolillo 2016-10-04 10:49:07 +02:00
parent de699f1832
commit f63ebcf854
3 changed files with 6 additions and 6 deletions

View File

@ -29,8 +29,8 @@ public class OkHttpFileUploadingTest {
RequestBody requestBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", "file.ext",
RequestBody.create(MediaType.parse("image/png"), new File("src/test/resources/test.in")))
.addFormDataPart("file", "file.txt",
RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt")))
.build();
Request request = new Request.Builder()
@ -51,8 +51,8 @@ public class OkHttpFileUploadingTest {
RequestBody requestBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", "file.ext",
RequestBody.create(MediaType.parse("image/png"), new File("src/test/resources/test.in")))
.addFormDataPart("file", "file.txt",
RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt")))
.build();

View File

@ -92,8 +92,8 @@ public class OkHttpPostingTest {
.setType(MultipartBody.FORM)
.addFormDataPart("username", "test")
.addFormDataPart("password", "test")
.addFormDataPart("file", "file.ext",
RequestBody.create(MediaType.parse("image/png"), new File("src/test/resources/test.in")))
.addFormDataPart("file", "file.txt",
RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt")))
.build();
Request request = new Request.Builder()