class_docstr: Represents an abstract RESTPlus resource.
  
  Concrete resources should extend from this class
  and expose methods for each supported HTTP method.
  If a resource is invoked with an unsupported HTTP method,
  the API will return a response with status 405 Method Not Allowed.
  Otherwise the appropriate method is called and passed all arguments
  from the url rule used when adding the resource to an Api instance.
  See :meth:`~flask_restplus.Api.add_resource` for details.
class_docstr_tok: ["Represents","an","abstract","RESTPlus","resource",".","Concrete","resources","should","extend","from","this","class","and","expose","methods","for","each","supported","HTTP","method",".","If","a","resource","is","invoked","with","an","unsupported","HTTP","method",",","the","API","will","return","a","response","with","status","405","Method","Not","Allowed",".","Otherwise","the","appropriate","method","is","called","and","passed","all","arguments","from","the","url","rule","used","when","adding","the","resource","to","an","Api","instance",".","See",":","meth",":","`","~flask_restplus.Api.add_resource","`","for","details","."]
code: def dispatch_request(self, *args, **kwargs):
      # Taken from flask
      meth = getattr(self, request.method.lower(), None)
      if meth is None and request.method == "HEAD":
          meth = getattr(self, "get", None)
      assert meth is not None, (
          "Unimplemented method %r" % request.method
      )
  
      for decorator in self.method_decorators:
          meth = decorator(meth)
  
      self.validate_payload(meth)
  
      resp = meth(*args, **kwargs)
  
      if isinstance(resp, BaseResponse):
          return resp
  
      representations = self.representations or {}
  
      mediatype = request.accept_mimetypes.best_match(
          representations, default=None
      )
      if mediatype in representations:
          data, code, headers = unpack(resp)
          resp = representations[mediatype](data, code, headers)
          resp.headers["Content-Type"] = mediatype
          return resp
  
      return resp
  
file_path: flask-restplus/flask_restplus/resource.py
imports: from __future__ import unicode_literals
  from flask import request
  from flask.views import MethodView
  from werkzeug.wrappers import BaseResponse
  from .model import ModelBase
  from .utils import unpack
label_desc: Use image node_id 2 for calling the Resource obj's underlying member method code with example usage: obj.dispatch_request() and returns: resp, resp, resp