Class Request

  • All Implemented Interfaces:
    IUnknownPropertiesConsumer

    public final class Request
    extends java.lang.Object
    implements IUnknownPropertiesConsumer
    Http request information.

    The Request interface contains information on a HTTP request related to the event. In client SDKs, this can be an outgoing request, or the request that rendered the current web page. On server SDKs, this could be the incoming web request that is being handled.

    The data variable should only contain the request body (not the query string). It can either be a dictionary (for standard HTTP requests) or a raw request body.

    ### Ordered Maps

    In the Request interface, several attributes can either be declared as string, object, or list of tuples. Sentry attempts to parse structured information from the string representation in such cases.

    Sometimes, keys can be declared multiple times, or the order of elements matters. In such cases, use the tuple representation over a plain object.

    Example of request headers as object:

    ```json { "content-type": "application/json", "accept": "application/json, application/xml" } ```

    Example of the same headers as list of tuples:

    ```json [ ["content-type", "application/json"], ["accept", "application/json"], ["accept", "application/xml"] ] ```

    Example of a fully populated request object:

    ```json { "request": { "method": "POST", "url": "http://absolute.uri/foo", "query_string": "query=foobar", "data": { "foo": "bar" }, "cookies": "PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;", "headers": { "content-type": "text/html" }, "env": { "REMOTE_ADDR": "192.168.0.1" } } } ```

    • Constructor Summary

      Constructors 
      Constructor Description
      Request()  
      Request​(@NotNull Request request)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void acceptUnknownProperties​(@NotNull java.util.Map<java.lang.String,​java.lang.Object> unknown)  
      @Nullable java.lang.String getCookies()  
      @Nullable java.lang.Object getData()  
      @Nullable java.util.Map<java.lang.String,​java.lang.String> getEnvs()  
      @Nullable java.util.Map<java.lang.String,​java.lang.String> getHeaders()  
      @Nullable java.lang.String getMethod()  
      @Nullable java.util.Map<java.lang.String,​java.lang.String> getOthers()  
      @Nullable java.lang.String getQueryString()  
      @Nullable java.lang.String getUrl()  
      void setCookies​(@Nullable java.lang.String cookies)  
      void setData​(@Nullable java.lang.Object data)  
      void setEnvs​(@Nullable java.util.Map<java.lang.String,​java.lang.String> env)  
      void setHeaders​(@Nullable java.util.Map<java.lang.String,​java.lang.String> headers)  
      void setMethod​(@Nullable java.lang.String method)  
      void setOthers​(@Nullable java.util.Map<java.lang.String,​java.lang.String> other)  
      void setQueryString​(@Nullable java.lang.String queryString)  
      void setUrl​(@Nullable java.lang.String url)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Request

        public Request()
      • Request

        public Request​(@NotNull
                       @NotNull Request request)
    • Method Detail

      • getUrl

        @Nullable
        public @Nullable java.lang.String getUrl()
      • setUrl

        public void setUrl​(@Nullable
                           @Nullable java.lang.String url)
      • getMethod

        @Nullable
        public @Nullable java.lang.String getMethod()
      • setMethod

        public void setMethod​(@Nullable
                              @Nullable java.lang.String method)
      • getQueryString

        @Nullable
        public @Nullable java.lang.String getQueryString()
      • setQueryString

        public void setQueryString​(@Nullable
                                   @Nullable java.lang.String queryString)
      • getData

        @Nullable
        public @Nullable java.lang.Object getData()
      • setData

        public void setData​(@Nullable
                            @Nullable java.lang.Object data)
      • getCookies

        @Nullable
        public @Nullable java.lang.String getCookies()
      • setCookies

        public void setCookies​(@Nullable
                               @Nullable java.lang.String cookies)
      • getHeaders

        @Nullable
        public @Nullable java.util.Map<java.lang.String,​java.lang.String> getHeaders()
      • setHeaders

        public void setHeaders​(@Nullable
                               @Nullable java.util.Map<java.lang.String,​java.lang.String> headers)
      • getEnvs

        @Nullable
        public @Nullable java.util.Map<java.lang.String,​java.lang.String> getEnvs()
      • setEnvs

        public void setEnvs​(@Nullable
                            @Nullable java.util.Map<java.lang.String,​java.lang.String> env)
      • getOthers

        @Nullable
        public @Nullable java.util.Map<java.lang.String,​java.lang.String> getOthers()
      • setOthers

        public void setOthers​(@Nullable
                              @Nullable java.util.Map<java.lang.String,​java.lang.String> other)