Skip to content

Commit bd6343b

Browse files
committed
udpate
1 parent 6762dd4 commit bd6343b

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/base/FindUrlAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public static void doSendRequest(List<String> full_urls, String refererToUse) {
9898
} else {
9999
inputQueue.put(new RequestTask(url, RequestType.POST));
100100
inputQueue.put(new RequestTask(url, RequestType.JSON));
101+
inputQueue.put(new RequestTask(url, RequestType.XML));
101102
}
102103
}
103104
} catch (Exception e) {

src/base/RequestTask.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ public static void doPostJsonReq(String url,String proxyHost,int proxyPort,HashM
7979
postRequest.code();
8080
}
8181

82+
public static void doPostXmlReq(String url,String proxyHost,int proxyPort,HashMap<String,String> headers)
83+
{
84+
HttpRequest postRequest = HttpRequest.post(url);
85+
86+
postRequest = configHttpRequest(postRequest,proxyHost,proxyPort,headers);
87+
88+
89+
postRequest.header("Content-Type", "application/xml");
90+
postRequest.send("<?xml version=\"1.0\" \r\n"
91+
+ "encoding=\"UTF-8\"?>\r\n"
92+
+ "<request>\r\n"
93+
+ " <name>John</name>\r\n"
94+
+ "</request>");
95+
postRequest.code();
96+
}
97+
8298
public void sendRequest(String proxyHost,int proxyPort,HashMap<String,String> headers) {
8399

84100
if (!headers.keySet().contains(RefererKey)) {
@@ -94,6 +110,9 @@ public void sendRequest(String proxyHost,int proxyPort,HashMap<String,String> he
94110
if (requestType == RequestType.JSON) {
95111
doPostJsonReq(url,proxyHost,proxyPort,headers);
96112
}
113+
if (requestType == RequestType.XML) {
114+
doPostXmlReq(url,proxyHost,proxyPort,headers);
115+
}
97116
}
98117

99118

src/base/RequestType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ public enum RequestType {
44
GET,
55
POST,
66
JSON,
7+
XML,
78
}

0 commit comments

Comments
 (0)