微信公衆號服務號開發中服務器配置
參考見:http://www.qchcloud.cn/tn/article/31
微信公衆號服務號開發中服務器配置:
微信開發中所有服務器配置是以get請求請求你所配置的服務器的地址。
@ResponseBody
@RequestMapping(value = "api/wx/callback", method = RequestMethod.GET)
public void callback(HttpServletRequest request, HttpServletResponse response) {
try {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
// 開發者提交信息後,微信服務器將發送GET請求到填寫的服務器地址URL上,GET請求攜帶參數
String signature = request.getParameter("signature");// 微信加密簽名(token、timestamp、nonce。)
String timestamp = request.getParameter("timestamp");// 時間戳
String nonce = request.getParameter("nonce");// 隨機數
String echostr = request.getParameter("echostr");// 隨機字符串
//PrintWriter out = response.getWriter();