We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please use this template to ask your question so I can answer you better
I created a application in Astronomy and set the origin as https://market-performace.fatcat529.com.
I tried to do it on several api test tools such as Postman but it also doesn't work well.
const authHeader = btoa( ${process.env.NEXT_PUBLIC_ASTRONOMY_APPLICATION_ID}:${process.env.NEXT_PUBLIC_ASTRONOMY_APPLICATION_SECRET} );
${process.env.NEXT_PUBLIC_ASTRONOMY_APPLICATION_ID}:${process.env.NEXT_PUBLIC_ASTRONOMY_APPLICATION_SECRET}
const response = await fetch( "https://api.astronomyapi.com/api/v2/studio/moon-phase", { method: "GET", headers: { "X-Requested-With": "XMLHttpRequest", Authorization: Basic ${authHeader}, }, } );
Basic ${authHeader}
NEXT_PUBLIC_ASTRONOMY_APPLICATION_ID = 63cb8a55-5349-4e5c-9a76-835059d3f8bb
The text was updated successfully, but these errors were encountered:
You also need to pass a json payload in your fetch request body.
See https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body on how to set a body. Also the method should be POST not GET.
Sorry, something went wrong.
No branches or pull requests
Please use this template to ask your question so I can answer you better
Description of the issue
I created a application in Astronomy and set the origin as https://market-performace.fatcat529.com.
What did you try and what didn't work
I tried to do it on several api test tools such as Postman but it also doesn't work well.
Example code (if applicable)
const authHeader = btoa(
${process.env.NEXT_PUBLIC_ASTRONOMY_APPLICATION_ID}:${process.env.NEXT_PUBLIC_ASTRONOMY_APPLICATION_SECRET}
);
const response = await fetch(
"https://api.astronomyapi.com/api/v2/studio/moon-phase",
{
method: "GET",
headers: {
"X-Requested-With": "XMLHttpRequest",
Authorization:
Basic ${authHeader}
,},
}
);
Application ID (this will help trace the logs to see what went wrong)
NEXT_PUBLIC_ASTRONOMY_APPLICATION_ID = 63cb8a55-5349-4e5c-9a76-835059d3f8bb
The text was updated successfully, but these errors were encountered: