简体   繁体   English

如何在 postman 中使用 json 在返回响应中获取错误消息

[英]how to get error message at return response using json in postman

how to check only one value is accepted when the request is inserted?插入请求时如何检查只接受一个值? if both values are passes then send the error message using json.如果两个值都通过,则使用 json 发送错误消息。 Either RegNumber or Pan should be accepted.应该接受 RegNumber 或 Pan。 i am very new to this我对此很陌生

{  
  "email_id": "sample@example.com",
  "RegNumber": "AM47",
  "FromDate": 062020,
  "ToDate": 062022,
  "SchemaCode": 560043,
  "PAN": "ABC44X"
}

I think you meant by get error in json response means app should return Json when it crashes, so to do, we must use middlewares and when you expect some error in response override that response error with your own custom json dict with error details.我认为您的意思是 json 响应中出现错误意味着应用程序在崩溃时应返回 Json,因此,我们必须使用中间件,并且当您期望响应中出现一些错误时,使用您自己的自定义 Z466DEEC76ECDF5FCA6D38571F63 dict 覆盖该响应错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM