[Python] Curl command and postman is working by JS fetch isn't

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    Can someone suggest on the below issue please? I am able to call following API using CURL and also using Postman but when I try to write some code, Python or JS to fetch the response, it fails. Not even able to print the response code in the programs. I am using my personal laptop and there is no VPN.

    Following code not Working: Getting response code 403 (requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://openbanking.api.rabobank.com.au/public/cds-au/v1/banking/products)


    1. Javascript:

      const response = await fetch("https://openbanking.api.rabobank.com.au/public/cds-au/v1/banking/products", {
      headers: { "x-v": "3" }
      });

    2. Python:

      BASE_URL = "https://openbanking.api.rabobank.com.au/public/cds-au/v1/banking/products"
      HEADERS = {"x-v": "3"}

      resp = requests.get(BASE_URL, headers=HEADERS)

    Following things are working:


    1. CURL:

      curl -X GET "https://openbanking.api.rabobank.com.au/public/cds-au/v1/banking/products" -H "x-v: 3"

    2. Postman is working for the same API

    I want to write a program and get the response to process it further.

    Continue reading...

Compartilhe esta Página