今天遇到个错误,异常信息 java.lang.IllegalArgumentException: Expected authority at index 7: http:// ,中文意思就是说参数异常,权限预期错误,大概就是这个意思,本来应该是value,却给弄成了name
应该修改为如下代码:
不应该是 name, 应该 value
@PostMapping(value= "/服务名/v1-0/保密/保密")
@ResponseBody
Result addOrders(@Valid @RequestBody OrderForm form,
@RequestHeader(value = "保密Token")String token,
@RequestHeader(value = "保密Deviceid")String deviceid);
是个别名,源码如下:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.POST)
public @interface PostMapping {
/**
* Alias for {@link RequestMapping#name}.
*/
@AliasFor(annotation = RequestMapping.class)
String name() default "";
/**
* Alias for {@link RequestMapping#value}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] value() default {};
![](https://www.codeprj.com/image/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvMTU1MTQwOS8yMDE5MDYvMTU1MTQwOS0yMDE5MDYxOTIyMTA1NjU4MS0yMDc3NDI2OTMucG5n.png)
|