package com.huimv.datacollection;

import cn.hutool.http.HttpUtil;

import java.nio.charset.Charset;

/**
 * <p>
 *
 * </p>
 *
 * @author yinhao
 * @date 2021/7/8 15:26
 */
public class Main {

    public static void main(String[] args) {

        System.out.println("测试天气");
        String province = "浙江省";
        String city = "杭州市";
        String county = "余杭区";
        String url ="https://wis.qq.com/weather/common";
//      String param = "source=xw&weather_type=forecast_1h|forecast_24h|index|alarm|limit|tips&province="+province+"&city="+city+"&county="+county;
       String param =  "source=xw&weather_type=observe|forecast_1h|forecast_24h|index|alarm|limit|tips&province="+province+"&city="+city+"&county="+county;
        String result = HttpUtil.urlWithForm(url, param, Charset.defaultCharset(), true);
        System.out.println(result);
        String s = HttpUtil.get(result);
        System.out.println(s);
    }
}
