apache httpclient测试

类别:Java 点击:0 评论:0 推荐:

 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);

本文地址:http://com.8s8s.com/it/it14079.htm