Package ghidra.net.http
Class HttpUtil
java.lang.Object
ghidra.net.http.HttpUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpURLConnection
getContent
(String httpUrlString, Properties httpRequestProperties, boolean allowRedirect) Execute an HTTP/HTTPS GET request and return the resulting HttpURLConnection.static String
getFile
(String httpUrlString, Properties httpRequestProperties, boolean allowRedirect, File destFile) Download a file by executing an HTTP/HTTPS GET request.
-
Constructor Details
-
HttpUtil
public HttpUtil()
-
-
Method Details
-
getContent
public static HttpURLConnection getContent(String httpUrlString, Properties httpRequestProperties, boolean allowRedirect) throws MalformedURLException, IOException Execute an HTTP/HTTPS GET request and return the resulting HttpURLConnection.- Parameters:
httpUrlString
- HTTP/HTTPS URLhttpRequestProperties
- optional HTTP request header values to be included (may be null)allowRedirect
- allow site redirects to be handled if true- Returns:
- HttpURLConnection which contains information about the URL
- Throws:
MalformedURLException
- bad httpUrlString specifiedIOException
- if an error occurs while executing request
-
getFile
public static String getFile(String httpUrlString, Properties httpRequestProperties, boolean allowRedirect, File destFile) throws MalformedURLException, IOException Download a file by executing an HTTP/HTTPS GET request.- Parameters:
httpUrlString
- HTTP/HTTPS URLhttpRequestProperties
- optional HTTP request header values to be included (may be null)allowRedirect
- allow site redirects to be handled if truedestFile
- destination file- Returns:
- String representing the content-type of the file, or null if the information is not available
- Throws:
MalformedURLException
- bad httpUrlString specifiedIOException
- if an error occurs while executing request
-