/*
(non-Javadoc)

@see RestEndpoint#post(java.lang.String,
java.lang.Object, java.lang.reflect.Type)
553546
@Override
    public final <RQ, RS> Maybe<Response<RS>> post(String resource, RQ rq, Type type)
            throws RestEndpointIOException {
        HttpPost post = new HttpPost(spliceUrl(resource));
        Serializer serializer = getSupportedSerializer(rq);
        ByteArrayEntity httpEntity = new ByteArrayEntity(serializer.serialize(rq),
                ContentType.create(serializer.getMimeType()));
        post.setEntity(httpEntity);
        return executeInternal(post, new TypeConverterCallback<RS>(serializers, type));
    }
386676
@Transactional
  @PostMapping(
      value = "/{entityTypeId}",
      headers = "Content-Type=application/x-www-form-urlencoded")
  public void createFromFormPost(
      @PathVariable("entityTypeId") String entityTypeId,
      HttpServletRequest request,
      HttpServletResponse response) {
    Map<String, Object> paramMap = new HashMap<>();
    for (String param : request.getParameterMap().keySet()) {
      String[] values = request.getParameterValues(param);
      String value = values != null ? StringUtils.join(values, ',') : null;
      if (StringUtils.isNotBlank(value)) {
        paramMap.put(param, value);
      }
    }

    createInternal(entityTypeId, paramMap, response);
  }
1074405
public void form_send_POST(OvhSafeKeyValue<String>[] form, String type) throws IOException {
		String qPath = "/contact/form/send";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "form", form);
		addBody(o, "type", type);
		execN(qPath, "POST", sb.toString(), o);
	}
885719
public void doPost(HttpServletRequest request,
                        HttpServletResponse response) 
        throws ServletException, IOException
    {
        String target=null;
        response.sendRedirect(request.getContextPath()+
                              request.getServletPath()+"/"+
                              Long.toString(System.currentTimeMillis(),36)+
                              (target!=null?("#"+target):""));
    }
1286810
protected void doPost(String path) throws ClientException {
        this.readLock.lock();
        try {
            ClientResponse response = getResourceWrapper().rewritten(path, HttpMethod.POST)
                    .post(ClientResponse.class);
            errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, ClientResponse.Status.NO_CONTENT);
            response.close();
        } catch (ClientHandlerException ex) {
            throw new ClientException(ClientResponse.Status.INTERNAL_SERVER_ERROR, ex.getMessage());
        } finally {
            this.readLock.unlock();
        }
    }
846641
private static JSONObject doPostRequest(HttpPost httpPost, HashMap<String, String> params) throws JSONException {
    	JSONObject json = null;
        HttpClient postClient = HttpClientBuilder.create().build();
        HttpResponse response;
        
        try {
            response = postClient.execute(httpPost);
            
            if(response.getStatusLine().getStatusCode() == 200) {
                HttpEntity entity = response.getEntity();
                
                if (entity != null) {
                    InputStream instream = entity.getContent();  
                    String result = convertStreamToString(instream);
                    instream.close();
                    
                    json = new JSONObject(result);
                }
            } else {
            	json = UpworkRestClient.genError(response);
            }
        } catch (ClientProtocolException e) {
            json = UpworkRestClient.genError(HTTP_RESPONSE_503, "Exception: ClientProtocolException");
        } catch (IOException e) {
            json = UpworkRestClient.genError(HTTP_RESPONSE_503, "Exception: IOException");
        } catch (JSONException e) {
            json = UpworkRestClient.genError(HTTP_RESPONSE_503, "Exception: JSONException");  
        } catch (Exception e) {
            json = UpworkRestClient.genError(HTTP_RESPONSE_503, "Exception: Exception " + e.toString());
        } finally {
            httpPost.abort();
        }
        
        return json;
    }
262507
def post(self, endpoint, return_response=False, **kwargs):
        
        args = self.translate_kwargs(**kwargs)
        response = self.session.post(self.make_url(endpoint), **args)

        decoded_response = _decode_response(response)

        if return_response:
            return decoded_response, response
        return decoded_response
1304511
public JSONObject post(String path, JSONObject content, Map<String,String> headers)
            throws ServiceException, JSONException {
        String sub = getSegment(path, 4);
        if ("event".equals(sub)) {
            SlackEvent event = new SlackEvent(content);
            EventHandler eventHandler = getEventHandler(event.getType(), event);
            if (eventHandler == null) {
                throw new ServiceException("Unsupported handler type: " + event.getType()
                        + (event.getChannel() == null ? "" : (":" + event.getChannel())));
            }
            return eventHandler.handleEvent(event);
        } else {
            // action/options request
            SlackRequest request = new SlackRequest(content);
            String userId = getAuthUser(headers);
            // TODO: ability to map request.getUser() to corresponding MDW user
            String callbackId = request.getCallbackId();
            if (callbackId != null) {
                int underscore = callbackId.lastIndexOf('_');
                if (underscore > 0) {
                    String handlerType = callbackId.substring(0, underscore);
                    String id = callbackId.substring(callbackId.lastIndexOf('/') + 1);
                    ActionHandler actionHandler = getActionHandler(handlerType, userId, id,
                            request);
                    if (actionHandler == null)
                        throw new ServiceException("Unsupported handler type: " + handlerType);

                    return actionHandler.handleRequest(userId, id, request);
                }
            }
            throw new ServiceException(ServiceException.BAD_REQUEST, "Bad or missing callback_id");
        }
    }
759397
public Response post(String path) throws IOException, RESTException {
        return post(path, null, null);
    }
932001
@Override
	public <T extends Resource> T post(final String uri, final Parameters params) {
		return doRequest(uri).set(params).post();
	}
144072
@POST
    @Path("/_search")
    public Response searchWithPost()
            throws IOException {
        return execute(getResourceRequest(RequestTypeEnum.POST, RestOperationTypeEnum.SEARCH_TYPE));
    }
417900
def json_post(methodname, rtype, key):
    """"""
    return compose(
        reusable,
        map_return(registry(rtype), itemgetter(key)),
        basic_interaction,
        map_yield(partial(_json_as_post, methodname)),
        oneyield,
    )
375480
@Override
    public final <RQ, RS> Maybe<RS> postFor(String resource, RQ rq, Class<RS> clazz)
            throws RestEndpointIOException {
        return post(resource, rq, clazz).flatMap(new BodyTransformer<RS>());
    }
602504
@Override
	public Later<String> post(String object, Param... params)
	{
		return this.getBatchForGraph().post(object, params);
	}
412184
def post(self, endpoint, params=None, version='1.1', json_encoded=False):
        """"""
        return self.request(endpoint, 'POST', params=params, version=version, json_encoded=json_encoded)
466315
@Override
    public JSONObject post(String path, JSONObject content, Map<String, String> headers)
            throws ServiceException, JSONException {
        String[] segments = getSegments(path);
        if (segments.length == 2) {
            ServiceLocator.getAssetServices().createPackage(segments[1]);
            CacheRegistration.getInstance().refreshCache("PackageCache");
        }
        else if (segments.length == 3) {
            String asset = segments[1] + '/' + segments[2];
            if (segments[2].endsWith(".proc")) {
                try {
                    Query query = getQuery(path, headers);
                    if (query.getFilter("template") == null)
                        query.setFilter("template", "new");
                    ServiceLocator.getWorkflowServices().createProcess(asset, query);
                }
                catch (IOException ex) {
                    throw new ServiceException(ServiceException.INTERNAL_ERROR, ex.getMessage());
                }
            }
            else {
                ServiceLocator.getAssetServices().createAsset(asset);
            }
        }
        else {
            throw new ServiceException(ServiceException.BAD_REQUEST, "Invalid path: " + path);
        }
        return null;
    }
1018789
def post(self, resource, data=None, json=None):
        
        return self.do(resource, 'POST', data=data, json=json)