業務で使用するAPIの動作を値を確認するためにcurlを叩いて確認をしております。
提供されたcurlコマンドがmacのものだったのでwindows用に修正して使用しておりますが、あるAPIを取得curlで叩くとエラーが返ってきております。
The request could not be satisfiedや403 ERRORが記載されているのですが、
この場合の対処方法としてはサーバ側で設定する必要があるのでしょうか。
curlコマンドの記載が間違っていてエラーが返ってきているのなら正しい記載方法を教えて頂きたいです。
使用しているcurlコマンド xxxの箇所には必要な情報を記載した状態でcurlを叩いています。 curl -L -X GET "https://xxx/xxx/xxx" ^ -H "xxxxx: xxxxxx" ^ -H "xxxxx: xxxxxx" ^ -F "xxx=\"xxxx\"" ^ -F "xxx=\"xxxx\"" ^ -F "xxx=\"xxxx\"" ^ -F "xxx=\"xxxx\""
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <TITLE>ERROR: The request could not be satisfied</TITLE> </HEAD><BODY> <H1>403 ERROR</H1> <H2>The request could not be satisfied.</H2> <HR noshade size="1px"> Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. <BR clear="all"> If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. <BR clear="all"> <HR noshade size="1px"> <PRE> Generated by cloudfront (CloudFront) Request ID: xxxxxxx </PRE> <ADDRESS> </ADDRESS> </BODY></HTML>
参考にしたサイト
・MAC用のcurlコマンドをwindows用に変更する際にみたサイト
https://nitoblab.itu-toki.com/2018/01/30/curl/
http://dim5.net/windows-server/curl-jsondata-postmethod.html
・The request could not be satisfiedについて
https://aws.amazon.com/jp/premiumsupport/knowledge-center/resolve-cloudfront-bad-request-error/