【发布时间】:2018-11-02 07:43:29
【问题描述】:
我是 Spring Boot Rest 服务的新手。我使用 maven 项目在 spring boot 中开发了一些 rest api。
我已经成功开发了 Get 和 Post Api。我的 GET 方法在邮递员和移动设备中正常工作。 当我尝试从邮递员发送 post 方法时,它可以正常工作,但从移动端发送 403 禁止错误。
这是我的配置:
spring.datasource.url = jdbc:mysql://localhost/sampledb?useSSL=false
spring.datasource.username = te
spring.datasource.password = test
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL5InnoDBDialect
Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
请建议我如何解决错误。
【问题讨论】:
-
您是否使用邮递员发送任何标题?我认为您正在发送令牌以验证请求。您是否通过移动设备在 POST 上发送此令牌?
-
请添加您的 spring-boot 配置的详细信息。
-
我只发送来自邮递员和手机@desoss的内容类型
-
请附上日志,spring 在日志中有令人惊讶的可读错误消息;)
-
这是我的配置:#spring.datasource.url = jdbc:mysql://192.168.4.2/maha?useSSL=false #spring.datasource.username = test #spring.datasource.password = test@123 # # ### Hibernate Properties ## SQL 方言使 Hibernate 为所选数据库生成更好的 SQL #spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect # ## Hibernate ddl auto (create ,创建删除,验证,更新)#spring.jpa.hibernate.ddl-auto = 更新@JannikWeichert
标签: spring rest maven spring-boot