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. def _read(size: Int): Unit

    Permalink
    Definition Classes
    Readable
  5. var _read: Function

    Permalink
    Definition Classes
    Readable
  6. def _readableState: ReadableState

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

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

    Permalink

    See also

    Request.accepts(String)

  9. 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).

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

    Permalink
    Definition Classes
    IEventEmitter
  11. 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

  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. 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).

  14. 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

  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. 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 {}.

  17. var domain: String

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    ClientRequest
  27. 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.
  28. 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.

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

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

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

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

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

    Permalink
    Definition Classes
    ClientRequest
  34. 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.

  35. 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.

  36. 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.

  37. 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.

  38. final def isInstanceOf[T0]: Boolean

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

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

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

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

    Permalink
    Definition Classes
    IEventEmitter
  43. def method: String

    Permalink

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

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

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

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

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

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

    Permalink
    Definition Classes
    IEventEmitter
  49. 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.

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

    Permalink

    Returns the value of param name when present.

  51. 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 {}.

  52. def path: String

    Permalink

    Contains the path part of the request URL.

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

    Permalink
    Definition Classes
    Readable
  54. def pipe(destination: Writable, options: |[ReadablePipeOptions, RawOptions]): Request.this.type

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

    Permalink
    Definition Classes
    Object
  56. 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.

  57. def push(chunk: Buffer): Boolean

    Permalink
    Definition Classes
    Readable
  58. def push(chunk: String, encoding: String): Boolean

    Permalink
    Definition Classes
    Readable
  59. 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, {}.

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

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

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

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

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

    Permalink
    Definition Classes
    Readable
  65. def route: String

    Permalink

    Contains the currently-matched route, a string.

  66. 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.

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    ClientRequest
  77. 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 {}.

  78. def socket: Socket

    Permalink
    Definition Classes
    ClientRequest
  79. 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

  80. def subdomains: Array[String]

    Permalink

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

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

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

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

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

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

    Permalink
    Definition Classes
    Readable
  86. var usingDomains: Boolean

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    ClientRequest
  95. 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