private RequestBuilder buildMultipart ( String name , String value ) { String boundary = "AJAX------" + Math . random ( ) + "" + new Date ( ) . getTime ( ) ; RequestBuilder builderPost = new RequestBuilder ( RequestBuilder . POST , url ) ; builderPost . setHeader ( "Content-Type" , "multipart/form-data; charset=utf-8; boundary=" + boundary ) ; builderPost . setCallback ( requestCallback ) ; String CRLF = "\r\n" ; String data = "--" + boundary + CRLF ; data += "--" + boundary + CRLF ; data += "Content-Disposition: form-data; " ; data += "name=\"" + name + "\"" + CRLF + CRLF ; data += value + CRLF ; data += "--" + boundary + "--" + CRLF ; builderPost . setRequestData ( data ) ; return builderPost ; }
prepare a multipart form http request