# eric6.Plugins.UiExtensionPlugins.Translator.TranslatorRequest

Module implementing a synchronous network request handler for translation requests.

### Global Attributes

None

### Classes

TranslatorRequest | Class implementing a synchronous network request handler for translation requests.

### Functions

None

## TranslatorRequest

Class implementing a synchronous network request handler for translation requests.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

TranslatorRequest | Constructor
get | Public method to issue a GET request.
post | Public method to issue a POST request.

### Static Methods

None

#### TranslatorRequest (Constructor)

TranslatorRequest(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### TranslatorRequest.get

get(requestUrl, extraHeaders=None)

Public method to issue a GET request.

requestUrl
  URL of the request (QUrl)
extraHeaders=
  list of tuples of additional headers giving header name (string) and header value (string)

Returns:
  server response (QByteArray) or error message (string)

#### TranslatorRequest.post

post(requestUrl, requestData, dataType="form", extraHeaders=None)

Public method to issue a POST request.

requestUrl
  URL of the request (QUrl)
requestData
  data of the request (QByteArray)
dataType=
  type of the request data (string)
extraHeaders=
  list of tuples of additional headers giving header name (string) and header value (string)

Returns:
  tuple of server response (string) and flag indicating success (boolean)

Up