Demos and Usage of org.apache.commons.httpclient.HttpStatus.HttpStatus.SC_OK


   1:             HttpVersion ver = request.getRequestLine().getHttpVersion();
   2:             response.setStatusLine(ver, HttpStatus.SC_OK);
   3:             response.addHeader(new Header("Connection", "close"));
   4:             response.addHeader(new Header("Set-Cookie", 
   5:                 "custno = 12345; comment=test; version=1," +

View Full Code Here
   1:         response.setHeader(new Header("Server", "test proxy"));
   2:         response.setStatusLine(ver, HttpStatus.SC_OK, "Connection established");
   3:         conn.writeResponse(response);
   4:         
   5:         SimpleHttpServerConnection target = new SimpleHttpServerConnection(targetSocket); 

View Full Code Here
   1:             } else if ("/hit/".equals(uri)) {
   2:                 response.setStatusLine(httpversion, HttpStatus.SC_OK);
   3:                 response.setBodyString("Hit!");
   4:         ...
   5:         }
   6:         assertEquals(HttpStatus.SC_OK, httpget.getStatusCode());
   7:         Header[] thisheader = httpget.getRequestHeaders("this-header");
   8:         ...
   9:         }
  10:         assertEquals(HttpStatus.SC_OK, httpget.getStatusCode());
  11:         assertEquals("test", httpget.getRequestHeader("User-Agent").getValue());

View Full Code Here
   1:     private HttpVersion ver = HttpVersion.HTTP_1_1;
   2:     private int statuscode = HttpStatus.SC_OK;
   3:         ...
   4:     private String phrase = HttpStatus.getStatusText(HttpStatus.SC_OK);
   5:     private HeaderGroup headers = new HeaderGroup();
   6:     private InputStream entity = null;

View Full Code Here
   1:             HttpVersion httpversion = request.getRequestLine().getHttpVersion();
   2:             response.setStatusLine(httpversion, HttpStatus.SC_OK);
   3:             response.addHeader(new Header("Set-Cookie", "name1=value1; path=/test"));
   4:         ...
   5:             HttpVersion httpversion = request.getRequestLine().getHttpVersion();
   6:             response.setStatusLine(httpversion, HttpStatus.SC_OK);
   7:             response.addHeader(new Header("Set-Cookie", "name1=value1; Path=\"/test\"; Version=\"1\""));
   8:         ...
   9:             HttpVersion httpversion = request.getRequestLine().getHttpVersion();
  10:             response.setStatusLine(httpversion, HttpStatus.SC_OK);
  11:             response.addHeader(new Header("Set-Cookie2", "name2=value2; Path=\"/test\"; Version=\"2\""));

View Full Code Here
   1:                 } if (authstr.equals("NTLM TlRMTVNTUAADAAAAGAAYAFIAAAAAAAAAagAAAAYABgBAAAAACAAIAEYAAAAEAAQATgAAAAAAAABqAAAABlIAAERPTUFJTlVTRVJOQU1FSE9TVJxndWIt46bHm11TPrt5Z6wrz7ziq04yRA==")) {
   2:                     response.setStatusLine(ver, HttpStatus.SC_OK);
   3:                     response.setBodyString("Authorization successful");
   4:         ...
   5:                 if (authstr.indexOf("NTLM") != -1) {
   6:                     response.setStatusLine(ver, HttpStatus.SC_OK);
   7:                     return true;
   8:         ...
   9:         assertNotNull(httpget.getStatusLine());
  10:         assertEquals(HttpStatus.SC_OK, httpget.getStatusLine().getStatusCode());
  11:     }

View Full Code Here
   1:                 } else {
   2:                     response.setStatusLine(ver, HttpStatus.SC_OK);
   3:                     response.setBodyString("Authorization successful");
   4:         ...
   5:         assertNotNull(httpget.getStatusLine());
   6:         assertEquals(HttpStatus.SC_OK, httpget.getStatusLine().getStatusCode());
   7:         Map table = AuthChallengeParser.extractParams(
   8:                 httpget.getRequestHeader("Authorization").getValue());
   9:         assertEquals("username", table.get("username"));

View Full Code Here
   1:                 if ((isCreate && status == HttpStatus.SC_CREATED)
   2:                         || (! isCreate && status == HttpStatus.SC_OK)){
   3:                     InputStream entryStream = post.getResponseBodyAsStream();
   4:                     Document<Entry> doc = Abdera.getNewParser().parse(entryStream);
   5:                     return new AtomClientResponse<Entry>(doc.getRoot(),post);

View Full Code Here