File tree Expand file tree Collapse file tree
rxhttp/src/main/java/rxhttp/wrapper/param Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,11 +159,8 @@ public final FormParam setProgressCallback(ProgressCallback callback) {
159159 }
160160
161161 @ Override
162- public RequestBody getRequestBody () {
163- final List <KeyValuePair > keyValuePairs = mKeyValuePairs ;
164- RequestBody requestBody = isMultiForm () ?
165- BuildUtil .buildFormRequestBody (keyValuePairs , mPartList )
166- : BuildUtil .buildFormRequestBody (keyValuePairs );
162+ public final RequestBody getRequestBody () {
163+ RequestBody requestBody = buildRequestBody (isMultiForm (), mKeyValuePairs , mPartList );
167164 try {
168165 long contentLength = requestBody .contentLength ();
169166 if (contentLength > uploadMaxLength )
@@ -180,6 +177,15 @@ public RequestBody getRequestBody() {
180177 return requestBody ;
181178 }
182179
180+ protected RequestBody buildRequestBody (
181+ boolean isMultiForm ,
182+ List <KeyValuePair > keyValuePairs ,
183+ List <Part > partList
184+ ) {
185+ return isMultiForm ? BuildUtil .buildFormRequestBody (keyValuePairs , partList )
186+ : BuildUtil .buildFormRequestBody (keyValuePairs );
187+ }
188+
183189 public ProgressCallback getCallback () {
184190 return mCallback ;
185191 }
You can’t perform that action at this time.
0 commit comments