Trait/Object

io.scalajs.npm.express

Request

Related Docs: object Request | package express

Permalink

trait Request extends ClientRequest

Express Http Request

Annotations
@RawJSType() @native()
See also

http://expressjs.com/en/api.html

Linear Supertypes
ClientRequest, Readable, IEventEmitter, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Request
  2. ClientRequest
  3. Readable
  4. IEventEmitter
  5. Object
  6. Any
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. var _read: Function0[Any]

    Permalink
    Definition Classes
    Readable
  5. def abort(): Unit

    Permalink
    Definition Classes
    ClientRequest
  6. def accepts(types: Array[String]): String

    Permalink

    See also

    Request.accepts(String)

  7. def accepts(type: String): String

    Permalink

    Checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.

    Checks if the specified content types are acceptable, based on the request’s Accept HTTP header field. The method returns the best match, or if none of the specified content types is acceptable, returns false (in which case, the application should respond with 406 "Not Acceptable").

    The type value may be a single MIME type string (such as “application/json”), an extension name such as “json”, a comma-delimited list, or an array. For a list or array, the method returns the best match (if any).

  8. def addListener(eventName: String, listener: Function): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  9. def app: Application

    Permalink

    This property holds a reference to the instance of the Express application that is using the middleware.

    This property holds a reference to the instance of the Express application that is using the middleware. If you follow the pattern in which you create a module that just exports a middleware function and require() it in your main file, then the middleware can access the Express instance via req.app

  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def baseUrl: String

    Permalink

    The URL path on which a router instance was mounted.

    The URL path on which a router instance was mounted. The req.baseUrl property is similar to the mountpath property of the app object, except app.mountpath returns the matched path pattern(s).

  12. def body: Any

    Permalink

    Contains key-value pairs of data submitted in the request body.

    Contains key-value pairs of data submitted in the request body. By default, it is undefined, and is populated when you use body-parsing middleware such as body-parser and multer. The following example shows how to use body-parsing middleware to populate req.body

  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def cookies: Any

    Permalink

    When using cookie-parser middleware, this property is an object that contains cookies sent by the request.

    When using cookie-parser middleware, this property is an object that contains cookies sent by the request. If the request contains no cookies, it defaults to {}.

  15. var domain: String

    Permalink
    Definition Classes
    IEventEmitter
  16. def emit(name: String, args: Any*): Any

    Permalink
    Definition Classes
    IEventEmitter
  17. def end(): Unit

    Permalink
    Definition Classes
    ClientRequest
  18. def end(data: Any): Unit

    Permalink
    Definition Classes
    ClientRequest
  19. def end(data: Any, encoding: String): Unit

    Permalink
    Definition Classes
    ClientRequest
  20. def end(data: Any, encoding: String, callback: Function): Unit

    Permalink
    Definition Classes
    ClientRequest
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def flushHeaders(): Unit

    Permalink
    Definition Classes
    ClientRequest
  25. def fresh: Boolean

    Permalink

    Indicates whether the request is “fresh.” It is the opposite of req.stale.

    Indicates whether the request is “fresh.” It is the opposite of req.stale. It is true if the cache-control request header doesn’t have a no-cache directive and any of the following are true:

    • The if-modified-since request header is specified and last-modified request header is equal to or earlier than the modified response header.
    • The if-none-match request header is *.
    • The if-none-match request header, after being parsed into its directives, does not match the etag response header.
  26. def get(field: String): UndefOr[String]

    Permalink

    Returns the specified HTTP request header field (case-insensitive match).

    Returns the specified HTTP request header field (case-insensitive match). The Referrer and Referer fields are interchangeable.

  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  28. def getMaxListeners(): Int

    Permalink
    Definition Classes
    IEventEmitter
  29. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. def headers: Dictionary[String]

    Permalink
    Definition Classes
    ClientRequest
  32. def hostname: String

    Permalink

    Contains the hostname derived from the Host HTTP header.

    Contains the hostname derived from the Host HTTP header. When the trust proxy setting does not evaluate to false, this property will instead have the value of the X-Forwarded-Host header field. This header can be set by the client or by the proxy.

  33. def ip: String

    Permalink

    Contains the remote IP address of the request.

    Contains the remote IP address of the request. When the trust proxy setting does not evaluate to false, the value of this property is derived from the left-most entry in the X-Forwarded-For header. This header can be set by the client or by the proxy.

  34. def ips: Array[String]

    Permalink

    When the trust proxy setting does not evaluate to false, this property contains an array of IP addresses specified in the X-Forwarded-For request header.

    When the trust proxy setting does not evaluate to false, this property contains an array of IP addresses specified in the X-Forwarded-For request header. Otherwise, it contains an empty array. This header can be set by the client or by the proxy.

    For example, if X-Forwarded-For is client, proxy1, proxy2, req.ips would be ["client", "proxy1", "proxy2"], where proxy2 is the furthest downstream.

  35. def is(type: String): Boolean

    Permalink

    Returns true if the incoming request’s “Content-Type” HTTP header field matches the MIME type specified by the type parameter.

    Returns true if the incoming request’s “Content-Type” HTTP header field matches the MIME type specified by the type parameter. Returns false otherwise.

  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. def isPaused(): Boolean

    Permalink
    Definition Classes
    Readable
  38. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  39. def listenerCount(eventName: String): Int

    Permalink
    Definition Classes
    IEventEmitter
  40. def listeners(eventName: String): Array[Function]

    Permalink
    Definition Classes
    IEventEmitter
  41. def method: String

    Permalink

    Contains a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on.

  42. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  43. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  44. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  45. def on(eventName: String, listener: Function): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  46. def once(eventName: String, listener: Function): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  47. def originalUrl: String

    Permalink

    This property is much like req.url; however, it retains the original request URL, allowing you to rewrite req.url freely for internal routing purposes.

    This property is much like req.url; however, it retains the original request URL, allowing you to rewrite req.url freely for internal routing purposes. For example, the “mounting” feature of app.use() will rewrite req.url to strip the mount point.

  48. def param(name: String, defaultValue: String): String

    Permalink

    Returns the value of param name when present.

  49. def params: Dictionary[String]

    Permalink

    This property is an object containing properties mapped to the named route “parameters”.

    This property is an object containing properties mapped to the named route “parameters”. For example, if you have the route /user/:name, then the “name” property is available as req.params.name. This object defaults to {}.

  50. def path: String

    Permalink

    Contains the path part of the request URL.

  51. def pause(): Request.this.type

    Permalink
    Definition Classes
    Readable
  52. def pipe(destination: Writable, options: RawOptions): Request.this.type

    Permalink
    Definition Classes
    Readable
  53. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  54. def protocol: String

    Permalink

    Contains the request protocol string: either http or (for TLS requests) https.

    Contains the request protocol string: either http or (for TLS requests) https. When the trust proxy setting does not evaluate to false, this property will use the value of the X-Forwarded-Proto header field if present. This header can be set by the client or by the proxy.

  55. def push(value: Any): Request.this.type

    Permalink
    Definition Classes
    Readable
  56. def query: Dictionary[String]

    Permalink

    Returns an object containing a property for each query string parameter in the route.

    Returns an object containing a property for each query string parameter in the route. If there is no query string, it is the empty object, {}.

  57. def read[T](size: Int): T

    Permalink
    Definition Classes
    Readable
  58. def removeAllListeners(): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  59. def removeAllListeners(eventName: String): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  60. def removeListener(eventName: String, listener: Function): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  61. def resume(): Request.this.type

    Permalink
    Definition Classes
    Readable
  62. def route: String

    Permalink

    Contains the currently-matched route, a string.

  63. def secure: Boolean

    Permalink

    A Boolean property that is true if a TLS connection is established.

    A Boolean property that is true if a TLS connection is established. Equivalent to: 'https' == req.protocol.

  64. def setEncoding(encoding: String): Request.this.type

    Permalink
    Definition Classes
    Readable
  65. def setMaxListeners(n: Int): Request.this.type

    Permalink
    Definition Classes
    IEventEmitter
  66. def setNoDelay(): Unit

    Permalink
    Definition Classes
    ClientRequest
  67. def setNoDelay(noDelay: Int): Unit

    Permalink
    Definition Classes
    ClientRequest
  68. def setSocketKeepAlive(): Unit

    Permalink
    Definition Classes
    ClientRequest
  69. def setSocketKeepAlive(initialDelay: Int): Unit

    Permalink
    Definition Classes
    ClientRequest
  70. def setSocketKeepAlive(enable: Boolean): Unit

    Permalink
    Definition Classes
    ClientRequest
  71. def setSocketKeepAlive(enable: Boolean, initialDelay: Int): Unit

    Permalink
    Definition Classes
    ClientRequest
  72. def setTimeout(timeout: Int): Unit

    Permalink
    Definition Classes
    ClientRequest
  73. def setTimeout(timeout: Int, callback: Function): Unit

    Permalink
    Definition Classes
    ClientRequest
  74. def signedCookies: Any

    Permalink

    When using cookie-parser middleware, this property contains signed cookies sent by the request, unsigned and ready for use.

    When using cookie-parser middleware, this property contains signed cookies sent by the request, unsigned and ready for use. Signed cookies reside in a different object to show developer intent; otherwise, a malicious attack could be placed on req.cookie values (which are easy to spoof). Note that signing a cookie does not make it “hidden” or encrypted; but simply prevents tampering (because the secret used to sign is private).

    If no signed cookies are sent, the property defaults to {}.

  75. def socket: Socket

    Permalink
    Definition Classes
    ClientRequest
  76. def stale: Boolean

    Permalink

    Indicates whether the request is “stale,” and is the opposite of req.fresh.

    Indicates whether the request is “stale,” and is the opposite of req.fresh.

    See also

    Request.fresh

  77. def subdomains: Array[String]

    Permalink

    An array of sub-domains in the domain name of the request.

  78. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  79. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  80. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  81. def unpipe(destination: Writable): Unit

    Permalink
    Definition Classes
    Readable
  82. def unshift(chunk: Any): Unit

    Permalink
    Definition Classes
    Readable
  83. var usingDomains: Boolean

    Permalink
    Definition Classes
    IEventEmitter
  84. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  85. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  86. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  87. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  88. def wrap(stream: Any): Unit

    Permalink
    Definition Classes
    Readable
  89. def write(chunk: Any): Unit

    Permalink
    Definition Classes
    ClientRequest
  90. def write(chunk: Any, encoding: String): Unit

    Permalink
    Definition Classes
    ClientRequest
  91. def write(chunk: Any, encoding: String, callback: Function): Unit

    Permalink
    Definition Classes
    ClientRequest
  92. def xhr: Boolean

    Permalink

    A Boolean property that is true if the request’s X-Requested-With header field is “XMLHttpRequest”, indicating that the request was issued by a client library such as jQuery.

Deprecated Value Members

  1. def param(name: String): UndefOr[String]

    Permalink

    Returns the value of param name when present.

    Returns the value of param name when present.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use params() instead

Inherited from ClientRequest

Inherited from Readable

Inherited from IEventEmitter

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped