Wednesday, March 25, 2009

WebScarab Methods

I always lose the link to WebScarab methods. I thought I'd post the info here for myself, and anyone else who happens to need this info too.

If you are new to webscarab, then check out the webscarab tutorials listed in the sidebar to the right. Link for all webscarab posts

The Message class provides the following methods, which are common to both the Request and Response classes:

Request & Response have the following methods:
  • String[] getHeaderNames()
  • String getHeader(String name)
  • void setHeader(String name, String value)
  • void addHeader(String name, String value)
  • void deleteHeader(String name)
  • NamedValue[] getHeaders()
  • void setheaders(NamedValue[] headers)
  • byte[] getContent()
  • void setContent(byte[] content)

The Request class adds the following methods:

  • String getMethod()
  • void setMethod(String method)
  • HttpUrl getURL()
  • void setURL(HttpUrl url)
  • void setURL(String url) throws MalformedURLException
  • String getVersion()
  • void setVersion(String version)

The Response class adds the following methods:

  • String getVersion();
  • void setVersion(String version);
  • String getStatus();
  • void setStatus(String status);
  • String getMessage();
  • void setMessage(String message);
  • String getStatusLine();

-Michael Coates