Post ---- Makes a POST request and executes a success or error callback when the request state changes
334995
function post(url, data, successCallback, errorCallback) {
    const request = new XMLHttpRequest();

    request.open('POST', url, true);
    request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');

    request.onreadystatechange = () => {
        if (request.readyState === 4) {
            /* Only 2xx codes are successful for the POST request. */
            if ((request.status >= 200) && (request.status < 300)) {
                successCallback(request.responseText);
            } else {
                console.error(`POST (${url}): error ${request.status} ${request.statusText}`);
                errorCallback(request.status, request.statusText);
            }
        }
    };

    request.send(data);
}
1313934
function execute(req, res) {
  // must coerce channel to string
  var len = this.state.pubsub.publish(
    req.conn, '' + req.args[0], req.args[1]);
  res.send(null, len);
}
274225
def post(self, request, *args, **kwargs):
        
        return self.subscribe(request, *args, **kwargs)
182124
def post(self, path, query=None, data=None, redirects=True):
        
        return self.request('POST', path, query, data, redirects)
357797
function buttonPostback(payload, callback)
{
  if (typeof payload.payload != 'string')
  {
    payload.payload = JSON.stringify(payload.payload);
  }

  callback(null, payload);
}
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")
802278
function execute(req, res) {
  Persistence.save(this.state.store, this.state.conf);
  res.send(null, Constants.OK);
}
210581
def post(self, uri, data, **kwargs):
        
        return self.request("POST", uri, data=data, **kwargs)
606333
function post(argv, callback) {
  if (!argv[2]) {
    console.error("url is required");
    console.error("Usage : post <url> <data>");
    process.exit(-1);
  }
  if (!argv[3]) {
    console.error("data is required");
    console.error("Usage : post <url> <data>");
    process.exit(-1);
  }
  util.post(argv[2], argv[3], function(err, val) {
    if (!err) {
      callback(null, argv[2]);
    } else {
      callback(err);
    }
  });
}
30900
function postForm({ url, payload, useBearer }) {
  return ajax({
    url,
    body: makeFormData( payload ),
    method: 'post',
    useBearer
  })
}
1372388
def post(self, request, *args, **kwargs):
        
        return self.approve(request, *args, **kwargs)
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
398503
function postback(payload, callback)
{
  if (typeof payload.payload == 'string')
  {
    payload.payload = JSON.parse(payload.payload);
  }

  callback(null, payload);
}
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();
    }
}
642979
function (req, res, options) {
    if (!options) {
      options = {};
    }
    options.operation = 'SAVE';
    options.res = res;
    if (req.params.model) {
      options.model = req.params.model;
    }
    if (req.body) {
      options.item = req.body;
    }
    if (req.params.data) {
      options.data = req.params.data;
    }
    exports.save.before(req, res, options);
    var userId = req.session['user-id'];
    vulpejs.models.save({
      model: options.model,
      item: options.item,
      data: options.data,
      validate: options.validate || false,
      userId: userId,
      callback: {
        success: function (item) {
          if (!vulpejs.utils.execute(options.callback, {
              item: item,
              postedItem: options.item,
              res: res,
            })) {
            exports.save.after(req, res, item);
            res.json({
              item: item,
              postedItem: options.item,
            });
          }
        },
        error: function (error) {
          exports.response.error(options, error);
        },
        validate: function (validate) {
          exports.response.validate(options, validate);
        },
      },
    });
  }
1122178
protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        // update counter
        numRequests++;

        try
        {
            // read request:
            LockManagerRemoteImpl.LockInfo info = (LockManagerRemoteImpl.LockInfo) buildObjectFromRequest(request);
            Object result = null;
            // now execute the command specified by the selector
            try
            {
                switch(info.methodName)
                {
                    case LockManagerRemoteImpl.METHOD_READ_LOCK:
                        {
                            result = new Boolean(lockmanager.readLock(info.key, info.resourceId, info.isolationLevel));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_RELEASE_SINGLE_LOCK:
                        {
                            result = new Boolean(lockmanager.releaseLock(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_RELEASE_LOCKS:
                        {
                            lockmanager.releaseLocks(info.key);
                            result = Boolean.TRUE;
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_WRITE_LOCK:
                        {
                            result = new Boolean(lockmanager.writeLock(info.key, info.resourceId,
                                    info.isolationLevel));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_UPGRADE_LOCK:
                        {
                            result = new Boolean(lockmanager.upgradeLock(info.key, info.resourceId, info.isolationLevel));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_CHECK_READ:
                        {
                            result = new Boolean(lockmanager.hasRead(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_CHECK_WRITE:
                        {
                            result = new Boolean(lockmanager.hasWrite(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_CHECK_UPGRADE:
                        {
                            result = new Boolean(lockmanager.hasUpgrade(info.key, info.resourceId));
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_LOCK_INFO:
                        {
                            result = lockmanager.getLockInfo();
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_LOCK_TIMEOUT:
                        {
                            result = new Long(lockmanager.getLockTimeout());
                            break;
                        }
                    case LockManagerRemoteImpl.METHOD_BLOCK_TIMEOUT:
                        {
                            result = new Long(lockmanager.getBlockTimeout());
                            break;
                        }
//                    case LockManagerRemoteImpl.METHOD_LOCK_TIMEOUT_SET:
//                        {
//                            lockmanager.setLockTimeout(info.lockTimeout);
//                            break;
//                        }
//
//                    case LockManagerRemoteImpl.METHOD_BLOCK_TIMEOUT_SET:
//                        {
//                            lockmanager.setBlockTimeout(info.blockTimeout);
//                            break;
//                        }
                    default :
                        {
                            throw new LockRuntimeException("Unknown command:" + info.methodName);
                        }
                }
            }
            catch(RuntimeException e)
            {
                result = new LockRuntimeException("Error while invoke specified method in servlet.", e);
            }

            ObjectOutputStream oos = new ObjectOutputStream(response.getOutputStream());
            oos.writeObject(result);
            oos.flush();
            oos.close();
        }
        catch(Throwable t)
        {
            lastError = t;
            t.printStackTrace();
        }
    }
1062224
function(options, callback) {
    request({
      method: 'post',
      url: options.url,
      headers: {
        'Authorization': 'Bearer ' + access_token,
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      form: options.data
    },
    function(error, response, body) {
      callback(error, body);
    });
  }