Implements the GET, POST and multipart POST request.