2728293031323334
public static Sender create(Request request) { if (request.isGet()) return new GetSender(request); else if (request.isMultipart()) return new FilePostSender(request); return new PostSender(request); }
212223242526272829
FileWriter fw = new FileWriter(f); fw.write("abc"); fw.flush(); fw.close(); req.getParams().put("file", f); FilePostSender sender = new FilePostSender(req); Response resp = sender.send(); assertEquals("image&3", resp.getContent()); }