Grow up

生活とプログラミング

Postman の Could not get any response を解決する方法 (.Net Core API)

はじめに

.Net Core APIにPostmanを使った確認でつまずいたので解決方法を書き残します。

現象

固定値を返すGETメソッドを作りました。
f:id:knkomko:20191001234731p:plain:w350

IIS Express で実行します。
f:id:knkomko:20191001234835p:plain:w350

APIにPostmanでGETリクエストの送信をしても応答が得られませんでした。
f:id:knkomko:20191001234100p:plain:w350

Could not get any response
There was an error connecting to .
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General

ブラウザからアクセスした場合には応答が確認できます。
f:id:knkomko:20191001233927p:plain:w350

解決方法

Postman の File -> Settings を左クリック。
f:id:knkomko:20191001233017p:plain:w350

General -> SSL certificate verification を OFF にします。
f:id:knkomko:20191001233118p:plain:w350

Postmanによるテストを実行して応答があることを確認します。
f:id:knkomko:20191001233545p:plain:w350

公式のチュートリアルには以下のような説明がありました。
f:id:knkomko:20191001235251p:plain:w350