#HTTP not s Request:

30 messages ยท Page 1 of 1 (latest)

sudden jasperBOT
#

๐Ÿ”Ž This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

๐Ÿ•ต๏ธ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

โœ… You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

orchid steeple
#

yes, we can make a fetch request in nextjs.
I don't see any problem with the code above yet. could you show more code where do you use fetchRating?

copper harbor
orchid steeple
#

oh do you mean you are trying to make http request on a site running on https?

noble turret
#

How is it possible

copper harbor
#

I have the page hosted on vercel but the data I need is on a http server

noble turret
#

The issue may be that it can't reach your api if it's hosted on your local host and not on the the same

orchid steeple
#

where do you call fetchRating()? on page load?

copper harbor
#

i do it when submiting data to the server

orchid steeple
#

you could create a route handler and fetch the http endpoint
/api/proxy?url=http://127.0.0.1:5000/result

orchid steeple
copper harbor
orchid steeple
#

could you turn this to server action?

orchid steeple
#

it should be fine if the http request is made on the server side

copper harbor
#

i put the whole fetch logic in a route once but it did not helped

orchid steeple
copper harbor
#

server is currently offline

orchid steeple
#

nm Im trying to fetch another endpoint on http

copper harbor
#

i am waiting for my partner to power it up

orchid steeple
#

let me deploy it to vercel

#

yes you can't make http request on a https site

copper harbor
#

xD ๐Ÿ™‚

orchid steeple
#

try fetch your api on server side

#

I can't find a http endpoint to test lol

#

the one I was trying redirect the request to https

#

or run your server on https

copper harbor
#

thanks anyway ๐Ÿ™‚