post表单、json接口
2021-05-02 20:27
标签:提交 setting multi str value col man import frame post表单、json接口 标签:提交 setting multi str value col man import frame 原文地址:https://www.cnblogs.com/sung1024/p/12127999.htmlpackage com.lv.qggz.man.dhht.api.typesetting;
import com.lv.qggz.man.dhht.api.typesetting.vo.UVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Author: sh
* @Description: TypeSettingController
* @Date: 22:00 2019/12/31
*/
@Controller
@RequestMapping("/api/typesetting")
public class TypeSettingController {
/**
* POST json提交
* @param json
* @param request
* @return
*/
@RequestMapping(value = "/hello", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String hello(@RequestBody String json, HttpServletRequest request) {
String head = request.getHeader("token");
System.out.println("head:" + head);
return json;
}
/**
* POST form表单,多附件提交
* @param uvo
* @param request
* @return
*/
@RequestMapping(value = "/word",method = RequestMethod.POST,produces = "application/json;charset=UTF-8",consumes = "multipart/form-data")
public String word(UVO uvo,HttpServletRequest request){
MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest) request;
List
System.out.println(uvo);
return null;
}
}