3
私はnode.jsを初めて使用しています。リクエストを使用してpost.butを送信しましたが、エラーが発生しました。要求は機能しません、エラー:無効なプロトコル:127.0.0.1 :?
request({
method: 'POST',
url: config.api + '/index',
body: {
name: "name"
},
json: true
})
throw er; // Unhandled 'error' event
^
Error: Invalid protocol: 127.0.0.1:
URLに「http://」接頭辞がありませんか? 'config.api'の値は何ですか? –
ありがとうございます、私は** http:// **を忘れています。どうもありがとうございました –