Generic POST query method
555734
def PKCS_POST_query(self, req_hook, req_args):
        '''  '''
        # HTTP POST queries require keyManagerTokens and sessionTokens
        headers = {'Content-Type': 'application/json',
                   'sessionToken': self.__session__,
                   'keyManagerToken': self.__keymngr__}

        # HTTP POST query to keymanager authenticate API
        try:
            if req_args is None:
                response = requests.post(self.__url__ + req_hook,
                                         headers=headers,
                                         cert=(self.__crt__, self.__key__),
                                         verify=True)
            else:
                response = requests.post(self.__url__ + req_hook,
                                         headers=headers,
                                         data=req_args,
                                         cert=(self.__crt__, self.__key__),
                                         verify=True)
        except requests.exceptions.RequestException as err:
            self.logger.error(err)
            return '500', 'Internal Error in PKCS_RESTful.POST_query()'
        # return the token
        self.logger.debug('%s: %s' % (response.status_code, response.text))
        return response.status_code, response.text
142396
def post(self):
        """"""
        self.reqparse.add_argument('namespacePrefix', type=str, required=True)
        self.reqparse.add_argument('description', type=str, required=True)
        self.reqparse.add_argument('key', type=str, required=True)
        self.reqparse.add_argument('value', required=True)
        self.reqparse.add_argument('type', type=str, required=True)
        args = self.reqparse.parse_args()

        if not self.dbconfig.namespace_exists(args['namespacePrefix']):
            return self.make_response('The namespace doesnt exist', HTTP.NOT_FOUND)

        if self.dbconfig.key_exists(args['namespacePrefix'], args['key']):
            return self.make_response('This config item already exists', HTTP.CONFLICT)

        self.dbconfig.set(args['namespacePrefix'], args['key'], _to_dbc_class(args), description=args['description'])
        auditlog(event='configItem.create', actor=session['user'].username, data=args)

        return self.make_response('Config item added', HTTP.CREATED)
994698
function postRouter(sessions, controllers, nonObjTemplatelogLevel, req, res, next) {

    if (req.originalUrl.match(/amorphic\/xhr\?path\=/) && url.parse(req.originalUrl, true).query.form && req.method === 'POST') {
        processPost(req, res, sessions, controllers, nonObjTemplatelogLevel);
    }
    else {
        next();
    }
}
743131
function postGetTags(id, cb) {
  var q  =
    'SELECT * FROM tags t ' +
      'JOIN posts_tags pt ON t.id = pt.tag_id AND pt.post_id = $1';

  db.getClient(function(err, client, done) {
    client.query(q, [id], function(err, r) {
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, r.rows);
        done();
      }
    });
  });
}
1007707
def _post(self, xml_query):
        ''''''
        req = urllib2.Request(url = 'http://www.rcsb.org/pdb/rest/search', data=xml_query)
        f = urllib2.urlopen(req)
        return f.read().strip()
841105
def post(self, object_type, object_id):
        """"""
        if object_id == 0:
            return Response(status=404)

        tagged_objects = []
        for name in request.get_json(force=True):
            if ':' in name:
                type_name = name.split(':', 1)[0]
                type_ = TagTypes[type_name]
            else:
                type_ = TagTypes.custom

            tag = db.session.query(Tag).filter_by(name=name, type=type_).first()
            if not tag:
                tag = Tag(name=name, type=type_)

            tagged_objects.append(
                TaggedObject(
                    object_id=object_id,
                    object_type=object_type,
                    tag=tag,
                ),
            )

        db.session.add_all(tagged_objects)
        db.session.commit()

        return Response(status=201)
974764
function(query) {
        var q = rql2es(_.rql(query)),
            mapFn = q.fields ?
                          function(x) { return x.fields; } 
                        : function(x) { return x._source; };
        return ajax('POST', this._url + '/_search', q)
            .then(function(result) {
                return result.hits.hits.map(mapFn);
            });
    }
804874
function Post($uri, $query_params = '') {
      $uri = $this->makeUri($uri);

      if (is_array($query_params)) {
        $postArray = array();
        reset($query_params);
        while (list($k, $v) = each($query_params)) {
          $postArray[] = urlencode($k) . '=' . urlencode($v);
        }

        $this->requestBody = implode('&', $postArray);
      }

// set the content type for post parameters
      $this->addHeader('Content-Type', 'application/x-www-form-urlencoded');

      if ($this->sendCommand('POST ' . $uri . ' HTTP/' . $this->protocolVersion)) {
        $this->processReply();
      }

      $this->removeHeader('Content-Type');
      $this->removeHeader('Content-Length');
      $this->requestBody = '';

      return $this->reply;
    }
1123035
async def _query_chunked_post(
        self, path, method="POST", *, params=None, data=None, headers=None, timeout=None
    ):
        
        if headers is None:
            headers = {}
        if headers and "content-type" not in headers:
            headers["content-type"] = "application/octet-stream"
        response = await self._query(
            path,
            method,
            params=params,
            data=data,
            headers=headers,
            timeout=timeout,
            chunked=True,
        )
        return response
1332304
function getPosts(filter, callback) {
      this.debug('getPosts', filter);
      this.__client.getPosts(filter || { type: 'post' }, callback.bind(this));
      return this;
    }
808572
def query_by_post(postid):
        '''
        
        '''
        return TabReply.select().where(
            TabReply.post_id == postid
        ).order_by(TabReply.timestamp.desc())
659073
private void sendQuery(Query query, V3ParameterList parameters, int maxRows, int fetchSize,
      int flags, ResultHandler resultHandler,
      BatchResultHandler batchHandler) throws IOException, SQLException {
    // Now the query itself.
    Query[] subqueries = query.getSubqueries();
    SimpleParameterList[] subparams = parameters.getSubparams();

    // We know this is deprecated, but still respect it in case anyone's using it.
    // PgJDBC its self no longer does.
    @SuppressWarnings("deprecation")
    boolean disallowBatching = (flags & QueryExecutor.QUERY_DISALLOW_BATCHING) != 0;

    if (subqueries == null) {
      flushIfDeadlockRisk(query, disallowBatching, resultHandler, batchHandler, flags);

      // If we saw errors, don't send anything more.
      if (resultHandler.getException() == null) {
        sendOneQuery((SimpleQuery) query, (SimpleParameterList) parameters, maxRows, fetchSize,
            flags);
      }
    } else {
      for (int i = 0; i < subqueries.length; ++i) {
        final Query subquery = subqueries[i];
        flushIfDeadlockRisk(subquery, disallowBatching, resultHandler, batchHandler, flags);

        // If we saw errors, don't send anything more.
        if (resultHandler.getException() != null) {
          break;
        }

        // In the situation where parameters is already
        // NO_PARAMETERS it cannot know the correct
        // number of array elements to return in the
        // above call to getSubparams(), so it must
        // return null which we check for here.
        //
        SimpleParameterList subparam = SimpleQuery.NO_PARAMETERS;
        if (subparams != null) {
          subparam = subparams[i];
        }
        sendOneQuery((SimpleQuery) subquery, subparam, maxRows, fetchSize, flags);
      }
    }
  }
919153
def post_json(path, object_to_post, response_type = nil)
      response_type = SimpleSolrClient::Response::GenericResponse if response_type.nil?
      response_type.new(_post_json(path, object_to_post))
    end
1131968
function (params, cb) {

            if (params) {
                params._method = 'POST';
            }

            params.formEncoded = true;

            if (typeof params.file != "undefined" || typeof params.url != "undefined") {

                _util.buildQuery('', params, function (error, data) {

                    return cb(error, data);

                });

            } else {

                return cb(new Error('Please provide file or url path!'));

            }

        }
1273834
def _get_query(self, **query_dict):
        """"""
        param_dict = query_dict.copy()
        return self._send_query(do_post=False, **param_dict)
1156306
def query_by_postid(postid, limit=5):
        '''
        
        '''
        recs = TabPostHist.select().where(
            TabPostHist.post_id == postid
        ).order_by(
            TabPostHist.time_update.desc()
        ).limit(limit)
        return recs
558834
def query_string(context, **kwargs):
    """"""
    params = context["request"].GET.copy()

    for key, value in list(kwargs.items()):
        params[key] = value

    return "?" + params.urlencode()