Java Client: Headers and form data

reezom

Posted on
Dec 09 2013

The Java client as of 1.2.6 does not support http headers and form data. I patched the library, adding the following to RaygunRequestMessage. Feel free to use.

      headers = new LinkedHashMap<String, String>();
      {
          Enumeration<?> e = request.getHeaderNames();
          while (e.hasMoreElements())
          {
              String name = (String)e.nextElement();
              String value = request.getHeader(name).toString();
              headers.put(name, value);
          };
      }
      form = new LinkedHashMap<String, String>();
      {
          Enumeration<?> e = request.getParameterNames();
          while (e.hasMoreElements())
          {
              String name = (String)e.nextElement();
              String[] values = request.getParameterValues(name);
              form.put(name, concat(values, ";"));
          }
    }         

John-Daniel Trask

Raygun

Posted on
Dec 10 2013

Thanks for this! We'll make sure this appears in the next release.


John-Daniel Trask

Raygun

Posted on
Dec 19 2013

I've added this code to the webprovider, it is now available from GitHub and will soon be deployed to Maven. The release containing this change is named v1.3.0. Thanks heaps for your work on this!

Regards,

Callum


Reply