Next.js Tutorial - 43 - API POST Request

Next.js Tutorial - 43 - API POST Request

Codevolution

2 года назад

105,977 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@thebarnowlsmusic
@thebarnowlsmusic - 25.10.2023 00:23

is this an AI talking ? this cadence is so bizarre.

Ответить
@guillermomazzari8320
@guillermomazzari8320 - 24.07.2023 18:14

Thank you very much for this video, it was exactly what I was looking for

Ответить
@spongebob93lover
@spongebob93lover - 06.04.2023 12:39

could someone please explain to me this note from the docs?
"You should not fetch an API Route from getStaticProps or getStaticPaths. Instead, write your server-side code directly in getStaticProps or getStaticPaths (or call a helper function)."
I still do not understand why I can only call an external API from all these pre-rendering method but not internal API route from within.

Ответить
@MaxMergenthal
@MaxMergenthal - 06.12.2022 18:16

your video solved my problem, thank you

Ответить
@ahmedshehata5601
@ahmedshehata5601 - 28.11.2022 13:38

deos the "POST" req will change on the original comments array or it will back to original state when i refresh the page

Ответить
@okage_
@okage_ - 13.11.2022 23:03

nice

Ответить
@OrincyWhyteDesigns
@OrincyWhyteDesigns - 04.11.2022 19:30

This was incredible!!!

Ответить
@MauriceDeFi
@MauriceDeFi - 04.09.2022 14:46

That's a gerat tutorial, thank you very much. How would you call an external service by sending a POST request to the server, add an authentication header and forward it to the external service? For example you have a form that the client fills out, sends the form data to the server, the server adds the authentication with a bearer token to the header and from there it sends the request to the actual endpoint.

Ответить
@jeffinj7707
@jeffinj7707 - 31.07.2022 10:04

When I used relative API URL it doesn't work for me, only absolute URLs will work. anyone have any idea what I am missing?

Ответить
@ultraza3
@ultraza3 - 28.06.2022 12:13

I am so glad that i started studying next js with your course, it makes process so easy!! Thank you so much my man

Ответить
@vincentpaladino8365
@vincentpaladino8365 - 19.05.2022 16:43

Lets say you wanted the use the submitComment rest request somewhere else in your code (i.e. not on CommentsPage), organizationally, what is the best place to put submitComment? In /api/comments.js?

Ответить
@CodeWithDolly
@CodeWithDolly - 05.05.2022 09:01

@codeelolution i am getting only id in response and not text... Can you help mw with that, Do i need to install any other things?

Ответить
@philippmakarov
@philippmakarov - 06.04.2022 14:58

Thank you so much! You just safed my project! :D

Ответить
@attilax2000
@attilax2000 - 31.03.2022 15:48

my post request never gets a response ... it's stays on "pending" ... Any tips ?

Ответить
@lmourabraga
@lmourabraga - 31.03.2022 04:50

Now I got how it works and you just saved me. Thanks!

Ответить
@younesalouani9073
@younesalouani9073 - 22.03.2022 01:02

To view the submitted comment on the UI instead of console.
Replace console.log(data) with setComments([data,...comments])

Ответить
@muhammadrahman376
@muhammadrahman376 - 23.01.2022 21:18

bro which please tell me the theme name

Ответить
@rushikeshjadhav7748
@rushikeshjadhav7748 - 12.01.2022 15:25

i am getting only id in rersponse and not text !!! can some one help
??

Ответить
@RubberDuckCoding
@RubberDuckCoding - 27.12.2021 17:10

VERY NICE!

Ответить
@maximk7816
@maximk7816 - 01.12.2021 20:09

Why do we need this API functionality?

Ответить
@sharkpyro93
@sharkpyro93 - 08.10.2021 23:07

if we are going to use api routes from client code, whats the point of using getServerSideProps?
and is it possibile to use getServerSideProps with post request?

Ответить
@junaiddaud1420
@junaiddaud1420 - 29.09.2021 18:23

but the comment is not saved in the json file.

Ответить
@suhakim5072
@suhakim5072 - 27.07.2021 10:18

Best videos.🥰

Ответить
@motielmakies631
@motielmakies631 - 26.07.2021 22:53

I've learned so much from you, much love!!!

Ответить