Handles the HTTP POST request.

        Attempts to interpret all HTTP POST requests as XML-RPC calls,
        which are forwarded to the server's _dispatch method for handling.
357958
def do_POST(self):
        

        # Check that the path is legal
        if not self.is_rpc_path_valid():
            self.report_404()
            return

        try:
            # Get arguments by reading body of request.
            # We read this in chunks to avoid straining
            # socket.read(); around the 10 or 15Mb mark, some platforms
            # begin to have problems (bug #792570).
            max_chunk_size = 10*1024*1024
            size_remaining = int(self.headers["content-length"])
            L = []
            while size_remaining:
                chunk_size = min(size_remaining, max_chunk_size)
                chunk = self.rfile.read(chunk_size)
                if not chunk:
                    break
                L.append(chunk)
                size_remaining -= len(L[-1])
            data = b''.join(L)

            data = self.decode_request_content(data)
            if data is None:
                return #response has been sent

            # In previous versions of SimpleXMLRPCServer, _dispatch
            # could be overridden in this class, instead of in
            # SimpleXMLRPCDispatcher. To maintain backwards compatibility,
            # check to see if a subclass implements _dispatch and dispatch
            # using that method if present.
            response = self.server._marshaled_dispatch(
                    data, getattr(self, '_dispatch', None), self.path
                )
        except Exception as e: # This should only happen if the module is buggy
            # internal error, report as HTTP server error
            self.send_response(500)

            # Send information about the exception if requested
            if hasattr(self.server, '_send_traceback_header') and \
                    self.server._send_traceback_header:
                self.send_header("X-exception", str(e))
                trace = traceback.format_exc()
                trace = str(trace.encode('ASCII', 'backslashreplace'), 'ASCII')
                self.send_header("X-traceback", trace)

            self.send_header("Content-length", "0")
            self.end_headers()
        else:
            self.send_response(200)
            self.send_header("Content-type", "text/xml")
            if self.encode_threshold is not None:
                if len(response) > self.encode_threshold:
                    q = self.accept_encodings().get("gzip", 0)
                    if q:
                        try:
                            response = gzip_encode(response)
                            self.send_header("Content-Encoding", "gzip")
                        except NotImplementedError:
                            pass
            self.send_header("Content-length", str(len(response)))
            self.end_headers()
            self.wfile.write(response)
1255261
def _handle_response(response, **kwargs) -> XMLResponse:
        
        if not response.encoding:
            response.encoding = DEFAULT_ENCODING

        return response
380228
def handle(self, request, uri):
        

        # Convert the call over to Stack-In-A-Box
        method = request.method
        headers = CaseInsensitiveDict()
        request_headers = CaseInsensitiveDict()
        request_headers.update(request.headers)
        request.headers = request_headers
        stackinabox_result = StackInABox.call_into(method,
                                                   request,
                                                   uri,
                                                   headers)

        # reformat the result for easier use
        status_code, output_headers, body = stackinabox_result

        json_data = None
        text_data = None
        content_data = None
        body_data = None

        # if the body is a string-type...
        if isinstance(body, six.string_types):
            # Try to convert it to JSON
            text_data = body
            try:
                json_data = json.dumps(text_data)
                text_data = json_data
            except Exception:
                json_data = None
                text_data = body

        # if the body is binary, then it's the content
        elif isinstance(body, six.binary_type):
            content_data = body

        # by default, it's just body data
        else:
            # default to body data
            body_data = body

        # build the Python requests' Response object
        return requests_mock.response.create_response(
            request,
            headers=output_headers,
            status_code=status_code,
            body=body_data,
            json=json_data,
            text=text_data,
            content=content_data
        )
1109083
async def post(self):
        

        request = self.request.body.decode()
        response = await methods.dispatch(request)
        if not response.is_notification:
            self.write(response)
1294770
def handle_request(self, msgtype, msgid, method, args, kwargs):
        """"""
        response = None
        error = None
        exception = None

        try:
            response = self.dispatch.call(method, args, kwargs)
        except Exception as e:
            error = (e.__class__.__name__, str(e))
            exception = e

        if isinstance(response, Deferred):
            response.add_callback(self.send_response, msgid)
            response.add_errback(self.send_error, msgid)
        else:
            if exception is None:
                self.send_response(msgid, response)
            else:
                self.send_error(msgid, exception)
585070
def _handle_post(self, transaction):
        
        path = str("/" + transaction.request.uri_path)
        transaction.response = Response()
        transaction.response.destination = transaction.request.source
        transaction.response.token = transaction.request.token

        # Create request
        transaction = self._server.resourceLayer.create_resource(path, transaction)
        return transaction
842619
def post_rsrc(rsrc, xml = '')
      validate_connected

      # convert CRs & to &#13;
      xml.gsub!(/\r/, '&#13;') if xml

      # send the data
      @last_http_response = @cnx[rsrc].post xml, content_type: 'text/xml', accept: :json
    rescue RestClient::ExceptionWithResponse => e
      handle_http_error e
    end
998716
def post(self, url, headers=None, body=None, kwargs=None):
        
        return self._request(
            method='post',
            url=url,
            headers=headers,
            body=body,
            kwargs=kwargs
        )
530452
def dispatch(self, request, *args, **kwargs):
        
        self.args = args
        self.kwargs = kwargs
        request = self.initialize_request(request, *args, **kwargs)
        self.request = request
        self.headers = self.default_response_headers  # deprecate?

        try:
            self.initial(request, *args, **kwargs)

            # Get the appropriate handler method
            if request.method.lower() in self.http_method_names:
                handler = getattr(self, request.method.lower(),
                                  self.http_method_not_allowed)
            else:
                handler = self.http_method_not_allowed

            response = handler(request, *args, **kwargs)

        except Exception as exc:
            response = self.handle_exception(exc)

        self.response = self.finalize_response(request, response, *args, **kwargs)
        return self.response
895471
def handle(self, sock, read_data, path, headers):
        ""
        try:
            sock.sendall("HTTP/1.0 %s %s\r\nConnection: close\r\nContent-length: 0\r\n\r\n" % (self.code, responses.get(self.code, "Unknown")))
        except socket.error, e:
            if e.errno != errno.EPIPE:
                raise
970480
def handle_xmlrpc(self, request_text):
        """"""

        response = self._marshaled_dispatch(request_text)

        sys.stdout.write('Content-Type: text/xml\n')
        sys.stdout.write('Content-Length: %d\n' % len(response))
        sys.stdout.write('\n')

        sys.stdout.write(response)
19106
def do_POST(self, request, response):
        # pylint: disable=C0103
        
        try:
            # Get the request content
            data = to_str(request.read_data())

            # Dispatch
            result = self._marshaled_dispatch(data, self._simple_dispatch)

            # Send the result
            response.send_content(200, result, "application/json-rpc")
        except Exception as ex:
            response.send_content(
                500, "Internal error:\n{0}\n".format(ex), "text/plain"
            )
418593
public void handle(String pathInContext,
                       String pathParams,
                       HttpRequest request,
                       HttpResponse response)
        throws HttpException, IOException
    {
        log.debug("Not Found");
        String method=request.getMethod();
        
        // Not found  requests.
        if (method.equals(HttpRequest.__GET)    ||
            method.equals(HttpRequest.__HEAD)   ||
            method.equals(HttpRequest.__POST)   ||
            method.equals(HttpRequest.__PUT)    ||
            method.equals(HttpRequest.__DELETE) ||
            method.equals(HttpRequest.__MOVE)   )
        {
            response.sendError(HttpResponse.__404_Not_Found,
                               request.getPath()+" Not Found");
        }
        
        else if (method.equals(HttpRequest.__OPTIONS))
        {
            // Handle OPTIONS request for entire server
            if ("*".equals(request.getPath()))
            {
                // 9.2
                response.setIntField(HttpFields.__ContentLength,0);
                response.setField(HttpFields.__Allow,
                                  "GET, HEAD, POST, PUT, DELETE, MOVE, OPTIONS, TRACE");
                response.commit();
            }
            else
                response.sendError(HttpResponse.__404_Not_Found);
        }
        else if (method.equals(HttpRequest.__TRACE))
        {
            handleTrace(request,response);
        }
        else
        {
            // Unknown METHOD
            response.setField(HttpFields.__Allow,
                              "GET, HEAD, POST, PUT, DELETE, MOVE, OPTIONS, TRACE");
            response.sendError(HttpResponse.__405_Method_Not_Allowed);
        }
    }
258971
def dispatch(self, request, *args, **kwargs):
        
        # this part copied from django source code
        if request.method.lower() in self.http_method_names:
            handler = getattr(self, request.method.lower(),
                              self.http_method_not_allowed)
        else:
            handler = self.http_method_not_allowed
        # we changed only this line - removed first 'request' argument
        return handler(*args, **kwargs)
1222456
def _post_xml(self, *args, **kwargs):
        

        if 'timeout' not in kwargs:
            kwargs['timeout'] = self.timeout

        req = self.session_xml.post(*args, **kwargs)
        return req
405981
public function handleRequest()
    {
        // Create the request very early so the ResourceManagement has a chance to grab it:
        $request = Request::createFromEnvironment();
        $response = new Response();
        $this->componentContext = new ComponentContext($request, $response);

        $this->boot();
        $this->resolveDependencies();
        $response = $this->addPoweredByHeader($response);
        $this->componentContext->replaceHttpResponse($response);
        $baseUriSetting = $this->bootstrap->getObjectManager()->get(ConfigurationManager::class)->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow.http.baseUri');
        if (!empty($baseUriSetting)) {
            $baseUri = new Uri($baseUriSetting);
            $request = $request->withAttribute(Request::ATTRIBUTE_BASE_URI, $baseUri);
            $this->componentContext->replaceHttpRequest($request);
        }

        $this->baseComponentChain->handle($this->componentContext);
        $response = $this->baseComponentChain->getResponse();

        $response->send();

        $this->bootstrap->shutdown(Bootstrap::RUNLEVEL_RUNTIME);
        $this->exit->__invoke();
    }
547344
def post(self, url, body=None):
        
        response = self.http.post(url,
                                  headers=self.headers,
                                  data=body,
                                  **self.requests_params)

        return self.process(response)