编程语言

img woowindice

apache httpclient测试

发表于2004/10/29 1:45:00  2754人阅读

分类: Jsp servlet

 org.apache.commons.httpclient.HostConfiguration  hostConfig  = new org.apache.commons.httpclient.HostConfiguration();
      hostConfig.setHost("www.youkone.com");
     
      org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient();
      client.setHostConfiguration(hostConfig);
      org.apache.commons.httpclient.methods.PostMethod method = new org.apache.commons.httpclient.methods.PostMethod("/login.ww");
     
      method.setParameter("username","ggg");
      method.setParameter("password","ggg");

      int code = client.executeMethod(method);
      ///////////////////////////////////////
      method = new org.apache.commons.httpclient.methods.PostMethod("/sendSMS.ww");

     method.setParameter("content","ggg");
     method.setParameter("destMobileID","13805861882");

     code = client.executeMethod(method);

阅读全文
0 0

相关文章推荐

img
取 消
img