File tree Expand file tree Collapse file tree
app/src/main/java/cn/darkal/networkdiagnosis/Activity Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717import net .lightbody .bmp .core .har .HarEntry ;
1818import net .lightbody .bmp .core .har .HarLog ;
1919import net .lightbody .bmp .core .har .HarNameValuePair ;
20+ import net .lightbody .bmp .core .har .HarPostDataParam ;
2021import net .lightbody .bmp .core .har .HarRequest ;
2122import net .lightbody .bmp .core .har .HarResponse ;
2223
@@ -91,8 +92,20 @@ public void initHarLog(int pos) {
9192 }
9293
9394 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+ }
96109 }
97110
98111 addItem ("Response Header" );
You can’t perform that action at this time.
0 commit comments