Accepts jsorpc post request.
        Retrieves data from request body.
335964
def post(self):
        
        # type(data) = dict
        data = json.loads(self.request.body.decode())
        # type(method) = str
        method = data["method"]
        # type(params) = dict
        params = data["params"]
        if method == "sendmail":
            response = dispatch([sendmail],{'jsonrpc': '2.0', 'method': 'sendmail', 'params': [params], 'id': 1})
            #self.write(response)
        else:
            pass
1026006
@Override
  public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    if (req.getRequestURI().endsWith("upload")) {
      uploadCallback(req, resp);
    } else {
      resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
    }
  }
1021628
private Object postRequest(HttpMethod httpMethod, String restUrl, Map<String, String> params) throws IOException, WebServiceException {
		HttpURLConnection conn = null;
		BufferedWriter wr = null;
		try {
			// Make the URL
			urlString = new StringBuilder(this.host).append(restUrl);
            LOGGER.debug("Doing HTTP request: POST [{}]", urlString.toString());
			// Connection configuration
//            Proxy proxy = DEBUG_HTTP ? new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 8008)) : Proxy.NO_PROXY;			
            URL url = new URL(urlString.toString());
			conn = (HttpURLConnection) url.openConnection();
			conn.setDoInput(true);
			conn.setDoOutput(true);
			conn.setUseCaches(false);
			conn.setRequestMethod(HttpMethod.POST.name());
			conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
			conn.setRequestProperty("Connection", "Keep-Alive");

			wr = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream()));
			// Writes into the alive connection
			if (httpMethod != HttpMethod.POST) {
				params.put("http_method", httpMethod.name());
			}
			wr.write(this.makeParamsString(params, false));
			wr.flush();
			// Gets the response
			return this.readResponse(restUrl, conn);
        } catch (WebServiceException e) {
            LOGGER.debug("WebServiceException catched. Request error", e);
            throw e;
		} catch (IOException e) {
            LOGGER.debug("IOException catched. Request error", e);
			throw e;
		} catch (Exception e) {
            LOGGER.debug("Exception catched, throwing a new IOException. Request error", e);
            throw new IOException(e.getLocalizedMessage());
        } finally {
			if (wr != null) {
				wr.close();
			}
			if (conn != null) {
				conn.disconnect();
			}
		}
	}
552731
private byte[] readRequestBody() {
        int bytesLeft = m_request.getContentLength();
        if (bytesLeft <= 0) {
            return new byte[0];
        }

        int totalBytesRead = 0;
        try {
            byte[] byteBuffer = new byte[bytesLeft];
            try (InputStream inputStream = m_request.getInputStream()) {
                int bytesRead = -1;
                int offset = 0;
                while ((bytesRead = inputStream.read(byteBuffer, offset, bytesLeft)) > 0) {
                    offset += bytesRead;
                    bytesLeft -= bytesRead;
                    totalBytesRead += bytesRead;
                }
            }
            return byteBuffer;
        } catch (IOException e) {
            String errMsg =
                String.format("Error reading from input request; expected %d bytes; only read %d bytes",
                              m_request.getContentLength(), totalBytesRead);
            throw new RuntimeException(errMsg, e);
        }
    }
1359451
protected Response httpPut(String path, String body) throws JSONException {
        return httpPut(path, body, 204);
    }
89058
def handle_post(core, request, params)
      payload = params['payload'] || request.body.read
      dispatch(core, request, *params['splat'], payload)
    rescue JSON::ParserError
      [400, 'Invalid JSON payload']
    end
847319
@Override
	final protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setBufferSize(BUFFER_SIZE);
		postCount.incrementAndGet();
		try {
			reportingDoPost(req, resp);
		} catch (ThreadDeath t) {
			throw t;
		} catch (RuntimeException | ServletException | IOException e) {
			getLogger().log(Level.SEVERE, null, e);
			throw e;
		} catch (SQLException t) {
			getLogger().log(Level.SEVERE, null, t);
			throw new ServletException(t);
		}
	}
910028
def post_parse(self, uri, params={}, data={}):
        '''
        '''
        return self._request_parse(self.post, uri, params, data)
579385
public static JSONObject getJSONObject(HttpPost request, Integer method, HashMap<String, String> params) throws JSONException {
        switch (method) {
        case METHOD_PUT:
        case METHOD_DELETE:
        case METHOD_POST:
            return doPostRequest(request, params);
        default:
            throw new RuntimeException("Wrong http method requested");
        }
    }
522121
private void consumeInputFully(HttpServletRequest req) {
		try {
			ServletInputStream is = req.getInputStream();
			while (!is.isFinished() && is.read() != -1) {
			}
		} catch (IOException e) {
			log.info("Could not consume full client request", e);
		}
	}
990954
@Override
    public void doPost(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws ServletException, IOException {
        CallFuture<NaviRpcResponse> callFuture = new CallFuture<NaviRpcResponse>();
        try {
            NaviRpcExporter serviceExporter = getRpcExporter(httpRequest);
            String protocol = getProtocolByHttpContentType(httpRequest);
            LocalContext.getContext().setStartTime().setProtocol(protocol)
                    .setFromIp(IPUtils.getIpAddr(httpRequest))
                    .setServiceName(serviceExporter.getName());

            byte[] byteArray = ByteUtil.readStream(httpRequest.getInputStream(),
                    httpRequest.getContentLength());
            LocalContext.getContext().setReqByteSize(byteArray.length);

            NaviRpcRequest request = new NaviRpcRequest(serviceExporter, byteArray);
            processor.service(request, callFuture);
        } catch (InvalidRequestException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_BAD_REQUEST);
        } catch (InvalidProtocolException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_NOT_ACCEPTABLE);
        } catch (ServiceNotFoundException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_NOT_FOUND);
        } catch (CodecException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_BAD_REQUEST);
            callFuture.cancel(true);
        } catch (DeserilizeNullException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_BAD_REQUEST);
        } catch (MethodNotFoundException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_NOT_FOUND);
        } catch (ServerErrorException e) {
            callFuture.cancel(true);
            LOG.warn(e.getMessage());
            httpResponse.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
        } catch (Exception e) {
            callFuture.cancel(true);
            LOG.error(e.getMessage(), e);
            httpResponse.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
        } finally {
            try {
                buildHttpResponse(httpResponse, callFuture.get(), httpRequest.getContentType(),
                        httpRequest.getCharacterEncoding());
            } catch (InterruptedException e2) {
                LOG.error(e2.getMessage(), e2);
            }
            LocalContext.removeContext();
        }
    }
87292
def render_POST(self, request):
        
        def handleDecodeError(failure):
            """
            Return HTTP 400 Bad Request.
            """
            errMesg = "%s: %s" % (failure.type, failure.getErrorMessage())

            if self.logger:
                self.logger.error(errMesg)
                self.logger.error(failure.getTraceback())

            body = "400 Bad Request\n\nThe request body was unable to " \
                "be successfully decoded."

            if self.debug:
                body += "\n\nTraceback:\n\n%s" % failure.getTraceback()

            self._finaliseRequest(request, 400, body)

        request.content.seek(0, 0)
        timezone_offset = self._get_timezone_offset()

        d = threads.deferToThread(remoting.decode, request.content.read(),
            strict=self.strict, logger=self.logger,
            timezone_offset=timezone_offset)

        def cb(amf_request):
            if self.logger:
                self.logger.debug("AMF Request: %r" % amf_request)

            x = self.getResponse(request, amf_request)

            x.addCallback(self.sendResponse, request)

        # Process the request
        d.addCallback(cb).addErrback(handleDecodeError)

        return server.NOT_DONE_YET
245181
async def handle_post_request(self, environ):
        """"""
        length = int(environ.get('CONTENT_LENGTH', '0'))
        if length > self.server.max_http_buffer_size:
            raise exceptions.ContentTooLongError()
        else:
            body = await environ['wsgi.input'].read(length)
            p = payload.Payload(encoded_payload=body)
            for pkt in p.packets:
                await self.receive(pkt)
166968
def post(request):
    
    data = request.POST or json.loads(request.body)['body']
    key = data.get('key', None)
    val = data.get('val', None)
    res = Result()
    if key is not None and val is not None:
        obj, created = UserPref.objects.get_or_create(user=request.user)
        if created:
            obj.data = json.dumps(DefaultPrefs.copy())
            obj.save()
        try:
            val = json.loads(val)
        except (TypeError, ValueError):
            pass
        obj.setKey(key, val)
        obj.save()
        res.append(obj.json())

    return JsonResponse(res.asDict())
1036044
void handleRequest(ByteBuf buffer) {
    long requestId = buffer.readLong();

    try {
      Object request = readRequest(buffer);
      HandlerHolder handler = handlers.get(request.getClass());
      if (handler != null) {
        handler.context.executor().execute(() -> handleRequest(requestId, request, handler));
      } else {
        handleRequestFailure(requestId, new SerializationException("unknown message type: " + request.getClass()), this.context);
      }
    } catch (SerializationException e) {
      handleRequestFailure(requestId, e, this.context);
    } finally {
      buffer.release();
    }
  }
1371550
@Override
  protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
      throws ServletException, IOException {

    final boolean noCache = null != req && Boolean.valueOf(req.getParameter(noCacheParamName));

    if (noCache || System.currentTimeMillis() - lastRefreshedTime > cacheTimeInMilliseconds) {
      this.populateStatistics(noCache);
    }

    JSONUtils.toJSON(cachedstats, resp.getOutputStream(), true);
  }
945628
protected Response request (String req)
        throws IOException
    {
        System.err.println("REQ:" + req);

        // send the request to the server
        _out.println(req);
        _out.flush();

        // now read the response
        String rspstr = _in.readLine();
        // if they closed the connection on us, we should deal
        if (rspstr == null) {
            throw new EOFException();
        }
        System.err.println("RSP:" + rspstr);

        // parse the response
        Response rsp = new Response();
        String codestr = rspstr;

        // assume the response is just a code unless we see a space
        int sidx = rspstr.indexOf(" ");
        if (sidx != -1) {
            codestr = rspstr.substring(0, sidx);
            rsp.message = rspstr.substring(sidx+1);
        }

        try {
            rsp.code = Integer.parseInt(codestr);
        } catch (NumberFormatException nfe) {
            rsp.code = 599;
            rsp.message = "Unparseable response";
        }

        return rsp;
    }