/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.common.http.interceptor;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;

import com.crunii.micro.common.http.HttpClientUtil;
import com.crunii.micro.common.utils.JsonUtil;

/**
 * @author 田平 create 2020年1月10日上午11:27:35
 *
 */
public class InterceptorTest {

	public static void main(String[] args) {
		testPostBody();
	}

	public static void testPostBody() {
		String url = "http://localhost:9995/TestController/paramDemo";
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userName", "TIANPING");
		params.put("password", "1231231");
		params.put("loginTime", new Date());
		StringEntity entity = new StringEntity(JsonUtil.getJsonString(params), ContentType.APPLICATION_JSON);
		String recvData = HttpClientUtil.reqStrByEntity(url, entity, "POST");
		System.out.println(recvData);
	}
}
