Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Nextjs:处理外部API POST方法的最佳方法_Javascript_Api_Post_Next.js_External - Fatal编程技术网

Javascript Nextjs:处理外部API POST方法的最佳方法

Javascript Nextjs:处理外部API POST方法的最佳方法,javascript,api,post,next.js,external,Javascript,Api,Post,Next.js,External,我正在为我在nextjs中的申请制作注册表格。我不知道哪种方法是处理外部API POST方法的最佳方法。你能帮帮我吗 在“pages/API/signup”中调用外部API POST方法,然后在“pages/signup”中使用fetch方法调用API 在名为signup_services的类的函数中调用外部API POST方法,然后在“pages/signup”中调用该函数 或者有没有比上面更好的方法

我正在为我在nextjs中的申请制作注册表格。我不知道哪种方法是处理外部API POST方法的最佳方法。你能帮帮我吗

  • 在“pages/API/signup”中调用外部API POST方法,然后在“pages/signup”中使用fetch方法调用API

  • 在名为signup_services的类的函数中调用外部API POST方法,然后在“pages/signup”中调用该函数

  • 或者有没有比上面更好的方法