/*
(non-Javadoc)

@see RestEndpoint#post(java.lang .String,
MultiPartRequest, java.lang.Class)
355301
@Override
    public final <RS> Maybe<Response<RS>> post(String resource, MultiPartRequest request, Class<RS> clazz)
            throws RestEndpointIOException {
        HttpPost post = buildMultipartRequest(spliceUrl(resource), request);
        return executeInternal(post, new ClassConverterCallback<RS>(serializers, clazz));
    }
1110269
public static String post(String urlString, Map<String, Object> paramMap) {
		return post(urlString, paramMap, HttpRequest.TIMEOUT_DEFAULT);
	}
644174
def post(self, json=None):
        
        return self._call('post', url=self.endpoint, json=json)
1032377
@Override
    public com.flickr4java.flickr.Response post(String path, Map<String, Object> parameters, String apiKey, String sharedSecret) throws FlickrException {

        OAuthRequest request = new OAuthRequest(Verb.POST, buildUrl(path));

        buildNormalPostRequest(parameters, request);

        OAuth10aService service = createAndSignRequest(apiKey, sharedSecret, request);

        try {
            return handleResponse(request, service);
        } catch (IllegalAccessException | InterruptedException | ExecutionException | InstantiationException | IOException | SAXException | ParserConfigurationException e) {
            throw new FlickrRuntimeException(e);
        }
    }
1043202
public static String post(String url, String body) {
        ExceptionUtil.notNull(url);
        return post(url, null, null, null, body, false);
    }
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();
        }
    }
342685
public static void post(HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
        addResource(Methods.POST, HandlerUtil.BASE_PATH, endpoint, mediaTypes);
    }
960465
public Object putRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
		return this.postRequest(HttpMethod.PUT, restUrl, params);
	}
536751
public static String doPost(String url, String ctype, byte[] content, int connectTimeout,
                                int readTimeout, String proxyHost, int proxyPort) throws IOException {
        HttpURLConnection conn = null;
        OutputStream out = null;
        String rsp = null;
        try {
            try {
                conn = null;
                if (!StringUtils.isEmpty(proxyHost)) {
                    conn = getConnection(new URL(url), METHOD_POST, ctype, proxyHost, proxyPort);
                } else {
                    conn = getConnection(new URL(url), METHOD_POST, ctype);
                }
                conn.setConnectTimeout(connectTimeout);
                conn.setReadTimeout(readTimeout);
            } catch (IOException e) {
                Map<String, String> map = getParamsFromUrl(url);
                AlipayLogger.logCommError(e, url, map.get("app_key"), map.get("method"), content);
                throw e;
            }
            try {
                out = conn.getOutputStream();
                out.write(content);
                rsp = getResponseAsString(conn);
            } catch (IOException e) {
                Map<String, String> map = getParamsFromUrl(url);
                AlipayLogger.logCommError(e, conn, map.get("app_key"), map.get("method"), content);
                throw e;
            }

        } finally {
            if (out != null) {
                out.close();
            }
            if (conn != null) {
                conn.disconnect();

            }
        }

        return rsp;
    }
770539
protected void setPost(JSONObject post) throws JSONException {
        params_ = post;
        if (getBranchRemoteAPIVersion() == BRANCH_API_VERSION.V2) {
            try {
                JSONObject userDataObj = new JSONObject();
                params_.put(Defines.Jsonkey.UserData.getKey(), userDataObj);
                DeviceInfo.getInstance().updateRequestWithV2Params(context_, prefHelper_, userDataObj);
            } catch (JSONException ignore) {
            }
        } else {
            DeviceInfo.getInstance().updateRequestWithV1Params(params_);
        }
    }
415066
public static Post post(String url, byte[] content, int connectTimeout, int readTimeout) {

        try {
            return new Post(url, content, connectTimeout, readTimeout);
        } catch (Exception e) {
            throw new HttpException("Failed URL: " + url, e);
        }
    }
1080497
public JSONObject post(String path, Map<String, Object> params) throws APIError {
        return request(Verb.POST, path, params);
    }
516212
@Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        Context context =
                ReadOnlyContext.getContext(Constants.HTTP_REQUEST.REST.uri,
                                           request);
        try {
            // Create a new file upload handler
            ServletFileUpload upload = new ServletFileUpload();

            // Parse the request, looking for "file"
            InputStream in = null;
            FileItemIterator iter = upload.getItemIterator(request);
            while (in == null && iter.hasNext()) {
                FileItemStream item = iter.next();
                logger.info("Got next item: isFormField={} fieldName={}", item.isFormField(), item.getFieldName());
                if (!item.isFormField() && item.getFieldName().equals("file")) {
                    in = item.openStream();
                }
            }
            if (in == null) {
                sendResponse(HttpServletResponse.SC_BAD_REQUEST,
                             "No data sent.",
                             response);
            } else {
                sendResponse(HttpServletResponse.SC_CREATED,
                             m_management.putTempStream(context, in),
                             response);
            }
        } catch (AuthzException ae) {
            throw RootException.getServletException(ae,
                                                    request,
                                                    "Upload",
                                                    EMPTY_STRING_ARRAY);
        } catch (Exception e) {
            e.printStackTrace();
            sendResponse(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e
                    .getClass().getName()
                    + ": " + e.getMessage(), response);
        }
    }
174756
public void doHttpPost(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
        httpClient.post(url, result, headers, contentType);
    }
648738
@Override
    public <TResponse> TResponse post(IReturn<TResponse> request) {
        return send(createUrl(request, HttpMethods.Post), HttpMethods.Post, request, request.getResponseType());
    }
1156321
def _rest_post(self, suburi, request_headers, request_body):
        
        return self._rest_op('POST', suburi, request_headers, request_body)
964876
def do_POST(self, request, response):
        # pylint: disable=C0103
        
        # Get the request JSON content
        data = jsonrpclib.loads(to_str(request.read_data()))

        # Convert from Jabsorb
        data = jabsorb.from_jabsorb(data)

        # Dispatch
        try:
            result = self._unmarshaled_dispatch(data, self._simple_dispatch)
        except NoMulticallResult:
            # No result (never happens, but who knows...)
            result = None

        if result is not None:
            # Convert result to Jabsorb
            if "result" in result:
                result["result"] = jabsorb.to_jabsorb(result["result"])

            # Store JSON
            result = jsonrpclib.jdumps(result)
        else:
            # It was a notification
            result = ""

        # Send the result
        response.send_content(200, result, "application/json-rpc")