GeezerVison is showing github.com — fix:修复requset postdata表单无法显示的bug · devil19/AndroidHttpCapture@5852f82
File tree
Expand file treeCollapse file tree
Open diff view settings
app/src/main/java/cn/darkal/networkdiagnosis/Activity
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/cn/darkal/networkdiagnosis/Activity/HarDetailActivity.java +15-2Lines changed: 15 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
17 | 17 | import net.lightbody.bmp.core.har.HarEntry; |
18 | 18 | import net.lightbody.bmp.core.har.HarLog; |
19 | 19 | import net.lightbody.bmp.core.har.HarNameValuePair; |
| 20 | +import net.lightbody.bmp.core.har.HarPostDataParam; |
20 | 21 | import net.lightbody.bmp.core.har.HarRequest; |
21 | 22 | import net.lightbody.bmp.core.har.HarResponse; |
22 | 23 |
|
@@ -91,8 +92,20 @@ public void initHarLog(int pos) { |
91 | 92 | } |
92 | 93 |
|
93 | 94 | if (harRequest.getPostData() != null) { |
94 | | - addItem("Request Content"); |
95 | | - addItem("PostData", harRequest.getPostData().getText()); |
| 95 | + if(harRequest.getPostData().getText()!= null |
| 96 | + && harRequest.getPostData().getText().length()>0) { |
| 97 | + addItem("Request Content"); |
| 98 | + addItem("PostData", harRequest.getPostData().getText()); |
| 99 | + } |
| 100 | + |
| 101 | + if(harRequest.getPostData().getParams()!= null |
| 102 | + && harRequest.getPostData().getParams().size()>0){ |
| 103 | + addItem("Request PostData"); |
| 104 | + |
| 105 | + for (HarPostDataParam pair : harRequest.getPostData().getParams()) { |
| 106 | + addItem(pair.getName(), pair.getValue()); |
| 107 | + } |
| 108 | + } |
96 | 109 | } |
97 | 110 |
|
98 | 111 | addItem("Response Header"); |
|