Skip to content

Commit ca1913e

Browse files
authored
Issue: 76028 (#99)
Allow to send a Body in a Http Get
1 parent 097bd12 commit ca1913e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

common/src/main/java/HTTPClient/HTTPConnection.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,14 +1044,21 @@ public HTTPResponse Get(String file, String query)
10441044
* the socket.
10451045
* @exception ModuleException if an exception is encountered in any module.
10461046
*/
1047-
public HTTPResponse Get(String file, String query, NVPair[] headers)
1047+
public HTTPResponse Get(String file, String query, NVPair[] headers)
1048+
throws IOException, ModuleException
1049+
{
1050+
return Get(file, query, headers, null);
1051+
}
1052+
1053+
1054+
public HTTPResponse Get(String file, String query, NVPair[] headers, byte data[])
10481055
throws IOException, ModuleException
10491056
{
10501057
String File = stripRef(file);
10511058
if (query != null && query.length() > 0)
10521059
File += "?" + Codecs.URLEncode(query);
10531060

1054-
return setupRequest("GET", File, headers, null, null);
1061+
return setupRequest("GET", File, headers, data, null);
10551062
}
10561063

10571064

common/src/main/java/com/genexus/internet/HttpClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ public void execute(String method, String url)
428428

429429
if (method.equalsIgnoreCase("GET"))
430430
{
431-
res = con.Get(url, "", hashtableToNVPair(headersToSend));
431+
if (contentToSend.size() > 0)
432+
res = con.Get(url, "", hashtableToNVPair(headersToSend), getData());
433+
else
434+
res = con.Get(url, "", hashtableToNVPair(headersToSend));
432435
}
433436
else if (method.equalsIgnoreCase("POST"))
434437
{

0 commit comments

Comments
 (0)