all post handlers go here
16819
function _postHandlers() {
  // any authentication checks first
  if(config.authentication.enabled) {
    logger.info(pkgname + "  authentication to API's enabled");
    app.all(config.api.path, function(req, res, next) {
      if(config.authentication.ignores && req.params) {
        // check if the params is in ignores list
        var matches = _.filter(req.params, function(param) {
          return _.find(config.authentication.ignores, function(ignore) {
            return param.indexOf(ignore)==0;
          });
        });
        if(matches && matches.length>0) {
          logger.debug(pkgname+"ignored auth for param:" + matches);
          return next();
        }
      }
      if(req.loggedIn) {
        return next();  // auth success go to next
      } else {
        return next(error(401, 'unauthorized access'));
      }
    });
  }

  // install api checks
  if(config.api.keycheck) {
    logger.info(pkgname + "  keycheck to API's enabled");
    // here we validate the API key 
    app.all(config.api.path, function(req, res, next){
      var key = req.query[config.api.KEYNAME] || req.body[config.api.KEYNAME];
 
      // key isnt present
      if (!key) return next(error(400, 'api key required'));
 
      // key is invalid
      if (!~config.api.keys.indexOf(key)) return next(error(401, 'invalid api key'));
 
      // all good, store req.key for route access
      req.key = key;
      next();
    });
  }

  // jsonp support for delete, put & post (partial post)
  if(config.server.jsonp) {
    logger.info(pkgname + "  jsonp support on api's enabled");
    // check if callback is there along with method
    app.all(config.api.path, function(req, res, next) {
      if(req.query && req.query['callback'] && req.query['_method']) {
        // lets rewrite the method, especially PUT/DELETE/POST
        req.method=req.query['_method'];
        logger.debug(pkgname + "jsonp request converted:"+req.query);
      }
      next();
    });
  }

  var api = {
    index: function(req,res) {
      res.json({app:config.app.title, version:config.app.version});
    }
  };
  global.apiresource = app.resource('api', api);
  logger.info(pkgname + "  api handler added");
  logger.debug(pkgname + "init complete");
}
888474
function on(element, type, handler, opt, hook) {
    var types = type.split(' ');
    Utils.each(types, function(type) {
      Utils.on(element, type, handler, opt);
      hook && hook(type);
    });
  }
1325160
def do_POST(self):
        """"""
        logging.debug("New POST request.")

        query = parse_qs(urlparse(self.path).query)
        sample = query['sample'][0]
        async = bool(int(query.get('async', [False])[0]))

        path = self.store_file(mkdtemp(), sample)
        command = query['command'][0].format(sample=path).split(' ')

        output = run_command(command, asynchronous=async)

        self.respond(output)
748488
function(context, handlers/*, params*/ ) {
        var args = this.slice(arguments)
        args.shift()
        args.shift()
        this.each(handlers, function(handler) {
            if (handler) handler.apply(context, args)
        })
    }
1069098
def execute_handler params={},path=nil
     case @type
     when :handlers
       @handlers.each do |handler_ident|
         handler = @context_ref.handlers.fetch(handler_ident) {raise "handler #{handler_ident} doesn't exist in context #{@context_ref.ref}"}
         component = handler.(params,path||@url,&:call)
         Context.current_context = @context_ref.ref
         if component.class == Proc
           component.call
         else
           Context.renderer.call(component,handler_ident)
         end
         Context.current_context = :no_context
       end
     when :context
       Context.wipe
       Context.render handlers
       History.push(@context_ref.ref,"",[],@context_ref.ref)
     end
    end
796614
def handle_POST(self):
        
        self.send_response(404)
        self.end_headers()
        self.wfile.write('not found'.encode('utf8'))
562228
def handler(self, environ, start_response):
        """"""

        if environ['REQUEST_METHOD'] == 'POST':
            return self.handle_POST(environ, start_response)
        else:
            start_response("400 Bad request", [('Content-Type', 'text/plain')])
            return ['']
255354
public Router post(@NotNull final Pattern regex, @NotNull final IMiddleware... handlers) {
        addRegEx("POST", regex, handlers, postBindings);
        return this;
    }
1018277
function (opt) {

			var actions = [];
			var handler = function () {
				actions.push(arguments);
			};
			include(opt, handler);
			return actions;
		}
1135439
protected function handlePOST()
    {
        $extract = $this->request->getParameterAsBool('extract', false);
        $clean = $this->request->getParameterAsBool('clean', false);
        $checkExist = $this->request->getParameterAsBool('check_exist', false);

        if (empty($this->filePath)) {
            $fileNameHeader = str_to_utf8($this->request->getHeader('X-File-Name'));
            $folderNameHeader = str_to_utf8($this->request->getHeader('X-Folder-Name'));
            $fileUrl = filter_var($this->request->getParameter('url', ''), FILTER_SANITIZE_URL);

            if (!empty($fileNameHeader)) {
                // html5 single posting for file create
                $result = $this->handleFileContent(
                    $this->folderPath,
                    $fileNameHeader,
                    $this->request->getContent(),
                    $this->request->getContentType(),
                    $extract,
                    $clean,
                    $checkExist
                );
            } elseif (!empty($folderNameHeader)) {
                // html5 single posting for folder create
                $fullPathName = $this->folderPath . $folderNameHeader;
                $content = $this->request->getPayloadData();
                $this->driver->createFolder($this->container, $fullPathName, $content);
                $result = ['name' => $folderNameHeader, 'path' => $fullPathName];
            } elseif (!empty($fileUrl)) {
                // upload a file from a url, could be expandable zip
                $tmpName = null;
                $newFileName = $this->request->input('filename', '');
                try {
                    $tmpName = FileUtilities::importUrlFileToTemp($fileUrl);
                    $result = $this->handleFile(
                        $this->folderPath,
                        $newFileName,
                        $tmpName,
                        '',
                        $extract,
                        $clean,
                        $checkExist
                    );
                    @unlink($tmpName);
                } catch (\Exception $ex) {
                    if (!empty($tmpName)) {
                        @unlink($tmpName);
                    }
                    throw $ex;
                }
            } elseif (null !== $uploadedFiles = $this->request->getFile('files')) {
                if (Arr::isAssoc($uploadedFiles)) { //Single file upload
                    $uploadedFiles = [$uploadedFiles];
                }
                $result = $this->handleFolderContentFromFiles($uploadedFiles, $extract, $clean, $checkExist);
                $result = ResourcesWrapper::cleanResources($result);
            } else {
                // possibly xml or json post either of files or folders to create, copy or move
                if (!empty($data = ResourcesWrapper::unwrapResources($this->getPayloadData()))) {
                    $result = $this->handleFolderContentFromData($data, $extract, $clean, $checkExist);
                    $result = ResourcesWrapper::cleanResources($result);
                } else {
                    // create folder from resource path
                    $this->driver->createFolder($this->container, $this->folderPath);
                    $result = ['name' => basename($this->folderPath), 'path' => $this->folderPath];
                }
            }
        } else {
            // create the file
            // possible file handling parameters
            $name = basename($this->filePath);
            $path = (false !== strpos($this->filePath, '/')) ? dirname($this->filePath) : '';
            $files = $this->request->getFile('files');

            if (empty($files)) {
                // direct load from posted data as content
                // or possibly xml or json post of file properties create, copy or move
                $result = $this->handleFileContent(
                    $path,
                    $name,
                    $this->request->getContent(),
                    $this->request->getContentType(),
                    $extract,
                    $clean,
                    $checkExist
                );
            } else {
                if (Arr::isAssoc($files)) { // Single file upload
                    $files = [$files];
                }
                if (1 < count($files)) {
                    throw new BadRequestException("Multiple files uploaded to a single REST resource '$name'.");
                }
                $file = array_get($files, 0);
                if (empty($file)) {
                    throw new BadRequestException("No file uploaded to REST resource '$name'.");
                }
                $error = $file['error'];
                if (UPLOAD_ERR_OK == $error) {
                    $result = $this->handleFile(
                        $path,
                        $name,
                        $file["tmp_name"],
                        $file['type'],
                        $extract,
                        $clean,
                        $checkExist
                    );
                } else {
                    throw new InternalServerErrorException("Failed to upload file $name.\n$error");
                }
            }
        }

        return ResponseFactory::create($result, null, ServiceResponseInterface::HTTP_CREATED);
    }
964821
function mountHandlers() {
  var self = this;

  for (var id in this.handlers) {
    this.handlers[id].forEach(function(handler) {
      self.namespace.on(id, handler);
    });
  }
}
1088705
function postProtected(url, data, callback) {
    post(url, data, callback, () => {
        setTimeout(
            postProtected.bind(null, url, data, callback),
            1500
        );
    });
}
894448
def post(self, urls=None, **overrides):
        """"""
        if urls is not None:
            overrides['urls'] = urls
        return self.where(accept='POST', **overrides)
1317208
static function executeInputHandlers( &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage )
    {
        $http = eZHTTPTool::instance();
        $functionName = 'fetchInput';
        $params = array( $http,
                         &$module,
                         &$class,
                         $object,
                         &$version,
                         $contentObjectAttributes,
                         $editVersion,
                         $editLanguage,
                         $fromLanguage );

       self::executeHandlerFunction( $functionName, $params );
    }
677834
def post(path, doc = nil, options = {}, &block)
      execute('POST', path, options, doc, &block)
    end
1121974
public function onPostLoad()
    {
        $aRoles = array();
        foreach ($this->getuserRoles() as $userRole) {
            $aRoles[] = $userRole->getRole()->getCanonicalName();
        }
        $this->setRoles($aRoles);
    }
69257
def post_params
			# Ensure post title is sanitized of all HTML
			if params[:post].include? :title
				params[:post][:title] = HTMLEntities.new.decode(Rails::Html::FullSanitizer.new.sanitize(params[:post][:title]))
			end

			params.require(:post).permit(:title,
			                             :body,
			                             images_attributes: [:id, :image, :_destroy])
		end