अनुरोध से जुड़ी गड़बड़ियों को ठीक करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Routes Preferred API, किसी तरीके के कॉल के जवाब के हिस्से के तौर पर गड़बड़ी के मैसेज दिखाता है. उदाहरण के लिए, अगर अनुरोध से एपीआई पासकोड को हटा दिया जाता है, तो यह तरीका यह दिखाता है:
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
अगर आपने origin
जैसे ज़रूरी बॉडी पैरामीटर को शामिल नहीं किया है, तो यह तरीका इन वैल्यू को दिखाता है:
{
"error": {
"code": 400,
"message": "Origin and destination must be set.",
"status": "INVALID_ARGUMENT"
}
}
गड़बड़ियों और उन्हें ठीक करने के बारे में ज़्यादा जानने के लिए, गड़बड़ियां लेख पढ़ें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-11-23 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-11-23 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe Routes Preferred API utilizes error messages within its responses to indicate issues with method calls.\u003c/p\u003e\n"],["\u003cp\u003eThese error messages provide specific details, including an error code, a descriptive message, and a status indicator, to help identify the cause of the error.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors include missing API keys, resulting in a "PERMISSION_DENIED" status, or omitting required parameters like "origin," leading to an "INVALID_ARGUMENT" status.\u003c/p\u003e\n"],["\u003cp\u003eFor a comprehensive understanding of errors and their handling within Google Cloud APIs, refer to the provided documentation on Errors.\u003c/p\u003e\n"]]],[],null,["# Handle request errors\n\nThe Routes Preferred API returns error messages as part of the\nresponse to a method call. For example, if you omit the API key from the\nrequest, the method returns: \n\n```json\n{\n \"error\": {\n \"code\": 403,\n \"message\": \"The request is missing a valid API key.\",\n \"status\": \"PERMISSION_DENIED\"\n }\n}\n```\n\nIf you omit a required body parameter, such as `origin`, the method\nreturns: \n\n```json\n{\n \"error\": {\n \"code\": 400,\n \"message\": \"Origin and destination must be set.\",\n \"status\": \"INVALID_ARGUMENT\"\n }\n}\n```\n\nFor more information on errors and error handling, see\n[Errors](https://cloud.google.com/apis/design/errors)."]]