Chilkat Online Tools

unicodeCpp / Core Services API / WithdrawByoipRange

Back to Collection Items

#include <CkHttpW.h>
#include <CkHttpResponseW.h>

void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttpW http;
    bool success;

    http.SetRequestHeader(L"opc-request-id",L"8wF");
    http.SetRequestHeader(L"x-content-sha256",L"{{content_sha256}}");
    http.SetRequestHeader(L"Authorization",L"{{signature}}");
    http.SetRequestHeader(L"Date",L"{{date}}");

    CkHttpResponseW *resp = http.QuickRequest(L"POST",L"https://iaas.{{region}}.oraclecloud.com/20160918/byoipRanges/:byoipRangeId/actions/withdraw");
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    int respStatusCode = resp->get_StatusCode();
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode != 204) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",resp->header());
        wprintf(L"Response Body:\n");
        wprintf(L"%s\n",resp->bodyStr());
        wprintf(L"Failed.\n");
        delete resp;
        return;
    }

    delete resp;
    wprintf(L"Success.\n");
    }

Curl Command

curl -X POST
	-H "opc-request-id: 8wF"
	-H "Date: {{date}}"
	-H "Authorization: {{signature}}"
	-H "x-content-sha256: {{content_sha256}}"
https://iaas.{{region}}.oraclecloud.com/20160918/byoipRanges/:byoipRangeId/actions/withdraw

Postman Collection Item JSON

{
  "name": "WithdrawByoipRange",
  "request": {
    "method": "POST",
    "header": [
      {
        "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
        "key": "opc-request-id",
        "value": "8wF"
      },
      {
        "key": "Date",
        "value": "{{date}}",
        "description": "(Required) Current Date",
        "type": "text"
      },
      {
        "key": "Authorization",
        "value": "{{signature}}",
        "description": "(Required) Signature Authentication on Authorization header",
        "type": "text"
      },
      {
        "key": "x-content-sha256",
        "value": "{{content_sha256}}",
        "description": "(Required) Content sha256 for POST, PUT and PATCH operations",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/byoipRanges/:byoipRangeId/actions/withdraw",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "byoipRanges",
        ":byoipRangeId",
        "actions",
        "withdraw"
      ],
      "variable": [
        {
          "key": "byoipRangeId",
          "value": "amet ut",
          "description": "(Required) The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the `ByoipRange` resource containing the BYOIP CIDR block."
        }
      ]
    },
    "description": "Withdraws BGP route advertisement for the BYOIP CIDR block.\n"
  },
  "response": [
    {
      "name": "The BYOIP CIDR block was withdrawn from BGP advertisement.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/byoipRanges/:byoipRangeId/actions/withdraw",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "byoipRanges",
            ":byoipRangeId",
            "actions",
            "withdraw"
          ],
          "variable": [
            {
              "key": "byoipRangeId"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Bad Request",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/byoipRanges/:byoipRangeId/actions/withdraw",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "byoipRanges",
            ":byoipRangeId",
            "actions",
            "withdraw"
          ],
          "variable": [
            {
              "key": "byoipRangeId"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "Unauthorized",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/byoipRanges/:byoipRangeId/actions/withdraw",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "byoipRanges",
            ":byoipRangeId",
            "actions",
            "withdraw"
          ],
          "variable": [
            {
              "key": "byoipRangeId"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "Internal Server Error",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/byoipRanges/:byoipRangeId/actions/withdraw",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "byoipRanges",
            ":byoipRangeId",
            "actions",
            "withdraw"
          ],
          "variable": [
            {
              "key": "byoipRangeId"
            }
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "An error has occurred.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/byoipRanges/:byoipRangeId/actions/withdraw",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "byoipRanges",
            ":byoipRangeId",
            "actions",
            "withdraw"
          ],
          "variable": [
            {
              "key": "byoipRangeId"
            }
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    }
  ]
}