Search in sources :

Example 1 with PostFormBuilder

use of com.benmu.framework.http.okhttp.builder.PostFormBuilder in project WeexErosFramework by bmfe.

the class AxiosManager method upload.

private void upload(String url, String filePath, Map<String, String> uploadParams, Map<String, String> heads, StringCallback callback) {
    PostFormBuilder builder = OkHttpUtils.post().url(url).params(uploadParams).headers(heads);
    String ext = AppUtils.getFileExtName(filePath);
    builder.addFile("file", TextUtils.isEmpty(ext) ? "file.jpg" : "file." + ext, new File(filePath));
    builder.build().execute(callback);
}
Also used : PostFormBuilder(com.benmu.framework.http.okhttp.builder.PostFormBuilder) File(java.io.File)

Aggregations

PostFormBuilder (com.benmu.framework.http.okhttp.builder.PostFormBuilder)1 File (java.io.File)1