# Interface: com.pnfsoftware.jeb.util.net.INet

Convenience network utility interface to issue common GET/POST \(http or https\) queries that return text contents. The primary network utility class in this package implements this interface.

## Method: downloadBinary
- parameter: `dstfile`, type: `java.io.File`
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `long`

Description: Download a binary and dump it to disk. Similar to [#queryBinary(String, Map, Map, IProgressCallback)](#queryBinary(String, Map, Map, IProgressCallback)), but the downloaded data is not stored and returned, therefore making this method more suitable to download Large files.
parameter: dstfile: destination file
parameter: url: url with optional parameters
parameter: urlParams: optional additional url parameters
parameter: serverHeaders: optional map whose keys indicate response headers to retrieve
parameter: progressCallback: optional listener
return: the number of bytes written
throws: on error

## Method: duplicate
- return type: `com.pnfsoftware.jeb.util.net.INet`

Description: Duplicate this object to perform safe parameter update.
return: a new net object with the same properties as this object \(timeouts, user\-agent, etc.\)

## Method: getConnectTimeout
- return type: `int`

Description: 
return: timeout in milliseconds

## Method: getReadTimeout
- return type: `int`

Description: 
return: timeout in milliseconds

## Method: getSecureSocketInfo
- return type: `com.pnfsoftware.jeb.util.net.SecureSocketInfo`

Description: 
return: optional secure socket customization information

## Method: getUserAgent
- return type: `java.lang.String`

Description: 
return: the user\-agent

## Method: getWriteTimeout
- return type: `int`

Description: 
return: timeout in milliseconds

## Method: post
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `bodyParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`

Description: Perform an http POST request to send a simple form.
parameter: url: url with optional parameters
parameter: urlParams: optional additional url parameters
parameter: bodyParams: request content parameters
parameter: serverHeaders: optional map whose keys indicate response headers to retrieve
return: the server response
throws: on error

## Method: post
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `bodyParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`

Description: Perform an http POST request to send a simple form.
parameter: url: url with optional parameters
parameter: urlParams: optional additional url parameters
parameter: bodyParams: request content parameters
return: the server response
throws: on error

## Method: postMultipart
- parameter: `url`, type: `java.lang.String`
- parameter: `formParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `formFiles`, type: `java.util.Map<java.lang.String,com.pnfsoftware.jeb.util.net.FormFileEntry>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`

Description: Perform an http POST request to send a form using the `multipart/form-data` encoding.
parameter: url: url with optional parameters
parameter: formParams: optional request content parameters
parameter: formFiles: optional request content files
parameter: serverHeaders: optional map whose keys indicate response headers to retrieve
return: the server response
throws: on error

## Method: postMultipart
- parameter: `url`, type: `java.lang.String`
- parameter: `formParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `formFiles`, type: `java.util.Map<java.lang.String,com.pnfsoftware.jeb.util.net.FormFileEntry>`
- return type: `java.lang.String`

Description: Perform an http POST request to send a multipart form.
parameter: url: url with optional parameters
parameter: formParams: optional request content parameters
parameter: formFiles: optional request content files
return: the server response
throws: on error

## Method: query
- parameter: `url`, type: `java.lang.String`
- parameter: `parameters`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`

Description: Perform an http GET request.
parameter: url: url with optional parameters
parameter: parameters: optional additional url parameters
parameter: serverHeaders: optional map whose keys indicate response headers to retrieve
return: the server response
throws: on error

## Method: query
- parameter: `url`, type: `java.lang.String`
- parameter: `parameters`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`

Description: Perform an http GET request.
parameter: url: url with optional parameters
parameter: parameters: optional additional url parameters
return: the server response
throws: on error

## Method: query
- parameter: `url`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Perform an http GET request.
parameter: url: url with optional parameters
return: the server response
throws: on error

## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `byte[]`

Description: Perform an http GET request.
parameter: url: url with optional parameters
parameter: urlParams: optional additional url parameters
parameter: serverHeaders: optional map whose keys indicate response headers to retrieve
parameter: progressCallback: optional listener
return: the server response
throws: on error

## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- parameter: `parameters`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `byte[]`

Description: Perform an http GET request.
parameter: url: url with optional parameters
parameter: parameters: optional additional url parameters
parameter: serverHeaders: optional map whose keys indicate response headers to retrieve
return: the server response
throws: on error

## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- parameter: `parameters`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `byte[]`

Description: Perform an http GET request.
parameter: url: url with optional parameters
parameter: parameters: optional additional url parameters
return: the server response
throws: on error

## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- return type: `byte[]`

Description: Perform an http GET request.
parameter: url: url with optional parameters
return: the server response
throws: on error

## Method: setConnectTimeout
- parameter: `timeout`, type: `int`

Description: 
parameter: timeout: in milliseconds

## Method: setReadTimeout
- parameter: `timeout`, type: `int`

Description: 
parameter: timeout: timeout in milliseconds

## Method: setSecureSocketInfo
- parameter: `info`, type: `com.pnfsoftware.jeb.util.net.SecureSocketInfo`

Description: 
parameter: info: optional secure socket customization information

## Method: setUserAgent
- parameter: `userAgent`, type: `java.lang.String`

Description: 
parameter: userAgent: a user\-agent

## Method: setWriteTimeout
- parameter: `timeout`, type: `int`

Description: 
parameter: timeout: timeout in milliseconds

