Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
MVPArms
提交
e1b7487d
M
MVPArms
项目概览
门心叼龙
/
MVPArms
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MVPArms
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e1b7487d
编写于
9月 19, 2017
作者:
J
jessyan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve comment
上级
17fb7970
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
42 deletion
+27
-42
arms/src/androidTest/java/com/jess/arms/ApplicationTest.java
arms/src/androidTest/java/com/jess/arms/ApplicationTest.java
+0
-13
arms/src/main/java/com/jess/arms/http/RequestInterceptor.java
.../src/main/java/com/jess/arms/http/RequestInterceptor.java
+27
-14
arms/src/test/java/com/jess/arms/ExampleUnitTest.java
arms/src/test/java/com/jess/arms/ExampleUnitTest.java
+0
-15
未找到文件。
arms/src/androidTest/java/com/jess/arms/ApplicationTest.java
已删除
100644 → 0
浏览文件 @
17fb7970
package
com.jess.arms
;
import
android.app.Application
;
import
android.test.ApplicationTestCase
;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public
class
ApplicationTest
extends
ApplicationTestCase
<
Application
>
{
public
ApplicationTest
()
{
super
(
Application
.
class
);
}
}
\ No newline at end of file
arms/src/main/java/com/jess/arms/http/RequestInterceptor.java
浏览文件 @
e1b7487d
/**
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2017 JessYan
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.http
;
import
android.support.annotation.Nullable
;
...
...
@@ -191,6 +191,13 @@ public class RequestInterceptor implements Interceptor {
}
}
/**
* 解析请求服务器的请求参数
*
* @param body
* @return
* @throws UnsupportedEncodingException
*/
public
static
String
parseParams
(
RequestBody
body
)
throws
UnsupportedEncodingException
{
if
(
isParseable
(
body
.
contentType
()))
{
try
{
...
...
@@ -210,6 +217,12 @@ public class RequestInterceptor implements Interceptor {
return
"This params isn't parsed"
;
}
/**
* 是否可以解析
*
* @param mediaType
* @return
*/
public
static
boolean
isParseable
(
MediaType
mediaType
)
{
if
(
mediaType
==
null
)
return
false
;
return
mediaType
.
toString
().
toLowerCase
().
contains
(
"text"
)
...
...
arms/src/test/java/com/jess/arms/ExampleUnitTest.java
已删除
100644 → 0
浏览文件 @
17fb7970
package
com.jess.arms
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public
class
ExampleUnitTest
{
@Test
public
void
addition_isCorrect
()
throws
Exception
{
assertEquals
(
4
,
2
+
2
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录