Handle Request Data persistence or output based on the request type.
7373
public function after() {
		if($this->_handle_ajax == true)
		{
			if($this->request->is_ajax())
			{
				$return = array();

				if(RD::has_messages() == false)
				{
					$return['status'] = 'success';
					$return['response'] = [''];
				}
				else if(RD::get_current(RD::ERROR) != null)
				{
					$return['status'] = 'error';
					$return['errors'] = RD::get_current(RD::ERROR);
				}
				else if(RD::get_current(array(RD::SUCCESS, RD::INFO)) != null)
				{
					$return['status'] = 'success';
					$return['response'] = RD::get_current(array(RD::SUCCESS, RD::INFO, RD::WARNING));
				}
				else
				{
					$return['status'] = 'success';
					$return['response'] = RD::get_current();
				}

				$this->response->headers('Content-Type', 'application/json');
				$this->response->body(json_encode($return));
			}
			else
			{
				//otherwise flash the messages so they can be used on the next page load
				if(RD::has_messages())
					RD::persist();

				parent::after();
			}
		}
		else
			parent::after();
	}
755972
def content_type(self, request=None, response=None):
        """"""
        if callable(self.outputs.content_type):
            return self.outputs.content_type(request=request, response=response)
        else:
            return self.outputs.content_type
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
280974
def request(self, request_type):
        '''  '''

        def _handler(func):
            self._handlers[request_type] = func
            return func

        return _handler
834296
public void persistInSession( HttpServletRequest request, HttpServletResponse response )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName =
                ScopedServletUtils.getScopedSessionAttrName( InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
        
        sh.setAttribute( rc, attrName, this );
    }
103362
public void handleData(String data) {
		if (data == null) return;
		text = data;
		sendEvent(new TextInputEvent(this.user, getPayload(), data));
		if (handler != null)
			handler.onType(data);
	}
1306506
def handle(self, handler_name, request, suffix=''):
        """"""
        return self.runtime.handle(self, handler_name, request, suffix)
460771
def handle_output(self, workunit, label, stream):
    """"""

    self._root_id_to_workunit_stack[str(workunit.root().id)][-1]['outputs'][label] += stream
804993
def http_method(self, data):
        """"""
        data = data.upper()
        if data in ['DELETE', 'GET', 'POST', 'PUT']:
            self._http_method = data

            # set content type for commit methods (best guess)
            if self._headers.get('Content-Type') is None and data in ['POST', 'PUT']:
                self.add_header('Content-Type', 'application/json')
        else:
            raise AttributeError(
                'Request Object Error: {} is not a valid HTTP method.'.format(data)
            )
357646
def manage_request_types_view(request):
    ''' 
    '''
    request_types = RequestType.objects.all()
    return render_to_response('manage_request_types.html', {
        'page_name': "Admin - Manage Request Types",
        'request_types': request_types
        }, context_instance=RequestContext(request))
680868
def handleHttpPost(request, endpoint):
    
    if request.mimetype and request.mimetype != MIMETYPE:
        raise exceptions.UnsupportedMediaTypeException()
    request = request.get_data()
    if request == '' or request is None:
        request = '{}'
    responseStr = endpoint(request)
    return getFlaskResponse(responseStr)
643451
def _validate_output_data(
        self, original_res, serialized_res, formatted_res, request):
        
        if self._is_doc_request(request):
            return
        else:
            return super(DocumentedResource, self)._validate_output_data(
                original_res, serialized_res, formatted_res, request)
1223115
def request(method, url, **kwargs):
    """"""
    _set_content_type(kwargs)
    if _content_type_is_json(kwargs) and kwargs.get('data') is not None:
        kwargs['data'] = dumps(kwargs['data'])
    _log_request(method, url, kwargs)
    response = requests.request(method, url, **kwargs)
    _log_response(response)
    return response
770970
def ProcessRequest(self, method_config, request):
        """"""
        if self.log_request:
            logging.info(
                'Calling method %s with %s: %s', method_config.method_id,
                method_config.request_type_name, request)
        return request
1106722
def process_request(self, request, response):
        """"""
        self.logger.info('Requested: {0} {1} {2}'.format(request.method, request.relative_uri, request.content_type))
490336
def post(self, request, *args, **kwargs):
        
        return self.update_type(request, *args, **kwargs)
337127
@SuppressWarnings("unchecked")
  private void handleResponseOk(long requestId, Object response) {
    ContextualFuture future = futures.remove(requestId);
    if (future != null) {
      future.context.executor().execute(() -> future.complete(response));
    }
  }