Skip to content

File .env charged but variables not working #272

@Wh1t3Rabyt3

Description

@Wh1t3Rabyt3

Hi,

I have create a nasa.env file, saved in the specific folder for NASA API requests.
The nasa.env contains information below:

# file: nasa.env
API_KEY=DEMO_KEY
ENV_NAME="test"
BASE_URL="https://api.nasa.gov/planetary/apod"

I have launched posting with the commande:

posting --collection mynasarequest --env nasa.env

Once in posting interface, I configured method to GET and the URL like below:

$BASE_URL?api_key=$API_KEY

Then CTRL + J and... 403 error:

{
  "error": {
    "code": "API_KEY_MISSING",
    "message": "No api_key was supplied. Get one at https://api.nasa.gov:443"
  }
}

I tried a different ways without .env file.

When I performed a request with the complete URL et API KEY (https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY) same 403 error.

I used the URL without variables et API_KEY set in Request > Query (key and value) and it worked.

Can you please help me to understand why the two other ways of performing the request are not working ?

Thank's a lot mate o/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions