-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-支持multipart数组上传
- Loading branch information
Showing
10 changed files
with
102 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.song.demo; | ||
|
||
import org.song.http.framework.HttpException; | ||
import org.song.http.framework.Interceptor; | ||
import org.song.http.framework.RequestParams; | ||
import org.song.http.framework.ResponseParams; | ||
|
||
/** | ||
* Created by song | ||
* Contact github.com/tohodog | ||
* Date 2019/12/18 | ||
* 多拦截器 | ||
*/ | ||
public class QSInterceptor2 implements Interceptor { | ||
@Override | ||
public ResponseParams intercept(Chain chain) throws HttpException { | ||
|
||
String url = chain.request().url(); | ||
if (url != null && !url.startsWith("http")) { | ||
url = API.HOST + url; | ||
} | ||
|
||
RequestParams newRequestParams = chain.request() | ||
.newBuild(url) | ||
.header("Interceptor2", "Interceptor2") | ||
//继续添加修改其他 | ||
.build(); | ||
|
||
|
||
ResponseParams responseParams = chain.proceed(newRequestParams); | ||
//请求结果参数如有需要也可以进行修改 | ||
return responseParams; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters