The setStatus method of the Response class establishes the status code for the response.
public void setStatus(String strStatus);