package com.fos.demo.fetcher;

import java.io.UnsupportedEncodingException;

import com.fos.core.fetcher.FetchEntity;
import com.fos.core.fetcher.HCFetcher;


public class FetcherExample {

    public static void main(String[] args) throws UnsupportedEncodingException {
        HCFetcher fetcher = HCFetcher.getInstance();
//        fetcher.setPolitenessDelay(3000);
//        FetchEntity entity = fetcher.post("http://aioubps.hkairlines.com/hkbaobiao/index.php?/ums/location", null);
//        if(entity.isSuccess())
//            System.out.println(entity.getContent("utf-8"));
//        
//        entity = fetcher.get("https://githuab.com/aas");
//        if(entity.isSuccess())
//            System.out.println(entity.getContent("utf-8"));
//        
//        entity = fetcher.post("http://aioubps.hkairlines.com/hkbaobiao/index.php?/ums/location", null);
//        if(entity.isSuccess())
//            System.out.println(entity.getContent("utf-8"));
        
        String t = "content={\"appkey\": \"e9c760b0eb86d04bf63fc74d1a29697f\",\"version_code\": \"1.0\",\"language\": \"zh\"}";
        FetchEntity entity = fetcher.post("http://cwl.okayapps.com/devburger/index.php?/ums/getApplicationUpdate", t.getBytes("utf-8"));
        if(entity.isSuccess())
            System.out.println(entity.getContent("utf-8"));
        fetcher.shutdown();
    }
}
