当前位置: 首页 > news >正文

http409报错原因

今天一个同事的接口突然报409,大概百度了一下,不是很清楚,谷歌也没找到特别好的解释

因为是直接调用的gitlab,就直接看了下gitlab的api

The following table shows the possible return codes for API requests.

Return valuesDescription
200 OKThe GET, PUT or DELETE request was successful, and the resource itself is returned as JSON.
202 AcceptedThe GET, PUT or DELETE request was successful, and the resource is scheduled for processing.
204 No ContentThe server has successfully fulfilled the request, and there is no additional content to send in the response payload body.
201 CreatedThe POST request was successful, and the resource is returned as JSON.
304 Not ModifiedThe resource hasn't been modified since the last request.
400 Bad RequestA required attribute of the API request is missing. For example, the title of an issue is not given.
401 UnauthorizedThe user isn't authenticated. A valid user token is necessary.
403 ForbiddenThe request isn't allowed. For example, the user isn't allowed to delete a project.
404 Not FoundA resource couldn't be accessed. For example, an ID for a resource couldn't be found.
405 Method Not AllowedThe request isn't supported.
409 ConflictA conflicting resource already exists. For example, creating a project with a name that already exists.
412The request was denied. This can happen if the If-Unmodified-Since header is provided when trying to delete a resource, which was modified in between.
422 UnprocessableThe entity couldn't be processed.
429 Too Many RequestsThe user exceeded the application rate limits.
500 Server ErrorWhile handling the request, something went wrong on the server.

gitlab解释的很清晰,就是说资源已经存在了,再次创建失败

那为什么接口没有将报错message展示出来,查了一下代码是因为直接屏蔽了409状态码,直接用postman访问接口会返回具体错误信息,错误提示信息示例:

示例1:

{

    "message": "Email has already been taken"

}

示例2:

{

    "message": "Username has already been taken"

}

找gitlab负责人查了下数据,确实是用户已经存在了,但是用户状态是blocked(禁用),问题解决

http://www.lryc.cn/news/5314.html

相关文章:

  • 设计模式:适配器模式(c++实现案例)
  • Python|每日一练|数组|回溯|哈希表|全排列|单选记录:全排列 II|插入区间|存在重复元素
  • Linux进程状态
  • 大数据第一轮复习笔记
  • HTML面试题
  • CUDA内存管理一文理清|参加CUDA线上训练营
  • Transformation(转换算子)
  • 总结如何设计一款营销低代码可视化海报平台
  • spark04-文件读取分区数据分配原理
  • 常见的网络安全攻击及防御技术概述
  • NetSuite Balancing Segment平衡段
  • Docker 中遇到的问题
  • 树莓派用默认账号和密码登录不上怎么办;修改树莓派的密码
  • 【LeetCode】不同的二叉搜索树 [M](卡特兰数)
  • 【软件相关】文献管理工具——Zotero
  • leetcode练习一:数组(二分查找、双指针、滑动窗口)
  • iPhone更新iOS 16.3出现应用卡死、闪退的问题怎么办?
  • TCP协议原理一
  • 【黑马SpringCloud(6)】Sentinel解决雪崩问题
  • 微信小程序 java springboot招聘求职应聘简历系统
  • 亿级高并发电商项目-- 实战篇 --万达商城项目 四(Dashboard服务、设置统一返回格式与异常处理、Postman测试接口 )
  • 为什么这11道JVM面试题这么重要(附答案)
  • 概率统计之概率篇
  • 综合项目 旅游网 【5.旅游线路收藏功能】
  • 【ArcGIS Pro二次开发】(3):UI管理_显示隐藏Tab、Group、Control等控件
  • Spring Boot开发实战——echarts图标填充数据
  • 李达聪老师:互联网时代的B2B品牌如何塑造
  • javaEE 初阶 — 连接管理机制
  • 40个改变你编程技能的小技巧!
  • iTOP3588开发板直连电脑配置方法(无线上网)配置主机IP