package com.fos.core.fetcher;

import java.io.UnsupportedEncodingException;


public class FetcherExample {

    public static void main(String[] args) throws UnsupportedEncodingException {
        HCFetcher fetcher = HCFetcher.getInstance();
        fetcher.setPolitenessDelay(3000);
        String data = "content={\"app_code\":\"FOS\",\"nickname\":\"TONY\",\"sys_name\":\"root\",\"arrive\":\"HKG\",\"flightNo\":\"HX0107\",\"name\":\"TONY\"}";
        FetchEntity entity = fetcher.post("http://123.56.146.81:8616/hk-fos-api-1.0/api/vipuser/enterUser", data.getBytes("utf-8"));
        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"));
//        
//        entity = fetcher.post("http://aioubps.hkairlines.com/hkbaobiao/index.php?/ums/location", null);
//        if(entity.isSuccess())
//            System.out.println(entity.getContent("utf-8"));
        fetcher.shutdown();
    }
}
