def requestTask(self, client, task, data, headers=None):<EOL>
if headers is None:<EOL><INDENT>headers = {}<EOL><DEDENT>headers.update(HTTPTestCase._DEFAULT_REQUEST_TASK_HEADERS)<EOL>return client.post(task, data=json.dumps(data), headers=headers)<EOL>
Request a task using POST and convert the given data to JSON.

:param client: The client to ZSL which will be used for the request.
:param task: Url which will be requested using POST method.
:param data: Data which will be posted and first converted to JSON.
:param headers: Dictionary of headers that'll be appended the
                Content-Type: application/json header.
:return: Flask response.