Search in sources :

Example 26 with JHttpContext

use of j.http.JHttpContext in project JFramework by gugumall.

the class Apple method main.

public static void main(String[] args) throws Exception {
    JHttp http = JHttp.getInstance();
    HttpClient client = http.createClient();
    JHttpContext context = new JHttpContext();
    String s1 = http.getResponse(context, client, "http://www.apple.com/cn/", "UTF-8");
    System.out.println(s1);
    context.addRequestHeader("Referer", "http://www.apple.com/cn/");
    String s2 = http.getResponse(context, client, "https://idmsa.apple.com/IDMSWebAuth/login.html?appIdKey=990d5c9e38720f4e832a8009a0fe4cad7dd151f99111dbea0df5e2934f267ec8&language=CN-zh&segment=R479&grpcode=g001&paramcode=h006&path=%2Fgeniusbar%2FR479%2Fsignin%2Fack&path2=%2Fgeniusbar%2FR479%2Fsignin%2Fack", "UTF-8");
    System.out.println(s2);
}
Also used : JHttpContext(j.http.JHttpContext) JHttp(j.http.JHttp) HttpClient(org.apache.http.client.HttpClient)

Aggregations

JHttpContext (j.http.JHttpContext)26 JUtilString (j.util.JUtilString)16 RemoteException (java.rmi.RemoteException)8 JHttp (j.http.JHttp)6 HttpClient (org.apache.http.client.HttpClient)5 HashMap (java.util.HashMap)4 ConcurrentMap (j.util.ConcurrentMap)3 Map (java.util.Map)2 InitialContext (javax.naming.InitialContext)2 Client (j.app.sso.Client)1 JObject (j.common.JObject)1 JDFSFile (j.fs.JDFSFile)1 ServiceBase (j.service.server.ServiceBase)1 ConcurrentList (j.util.ConcurrentList)1 JUtilTextWriter (j.util.JUtilTextWriter)1 File (java.io.File)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Properties (java.util.Properties)1 Context (javax.naming.Context)1