Skip to content

Commit c60dca6

Browse files
correct initialisation of header info in post
correct initialisation of header info in post to avoid null pointer error
1 parent 77586ce commit c60dca6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/http/requests/PostRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public PostRequest(String url, String encoding)
4545
this.encoding = encoding;
4646
nameValuePairs = new ArrayList<BasicNameValuePair>();
4747
nameFilePairs = new HashMap<String,File>();
48+
this.headerPairs = new ArrayList<BasicNameValuePair>();
4849
}
4950

5051
public void addUser(String user, String pwd)
@@ -117,6 +118,7 @@ public void send()
117118
// Clear it out for the next time
118119
nameValuePairs.clear();
119120
nameFilePairs.clear();
121+
headerPairs.clear();
120122

121123
} catch( Exception e ) {
122124
e.printStackTrace();

0 commit comments

Comments
 (0)