I'm trying to build a web page using an existing internal API. The API is a post method. We send up data to it and get a response.
I'm trying to use this in getServerSideProps, however I'm getting a 401. When I use it in a useEffect on page load, it works just fine.
Is it not possible to use a post API in getServerSideProps to hydrate the page.
export const getServerSideProps: GetServerSideProps = async (ctx) => {
// This just hits a post endpoint
const data = await apiService.valuation('1234');
return data;
return {
props: {},
};
};