Powershellでcurl - 2023/8/6
Powershellでもデフォルトでcurlコマンドを利用できるが、以下エラーが出る場合がある。
code:powershell
curl : Internet Explorer エンジンを使用できないか、Internet Explorer の初回起動構成が完了していないため、応
答のコンテンツを解析できません。UseBasicParsing
パラメーターを指定して再試行してください。
発生場所 行:1 文字:1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebR
equestCommand
裏でIE使ってるんですか?という感じだが、今後IEを立ち上げることは無いだろうということで回避したい。
これは、-UseBasicParsin オプションを付けると回避できる。
code:powershell
StatusCode : 200
StatusDescription : OK
Content : {
"message": null,
"results": [
{
"address1": "高知県",
"address2": "南国市",
"address3": "蛍が丘",
"kana1": "コウチケン",
"kana2": "ナンコクシ",
"kana3": "ホタルガオカ",
"prefcode": "39",
"zipcod...
RawContent : HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
X-Cloud-Trace-Context: 49f3e95f887c9f0250f1ec10d42ae201
Content-Length: 290
Content-Type: text/plain;charset=utf-8
Date: Sun, 06 Aug 2023 07:39:25 G...
Forms :
Images : {}
InputFields : {}
Links : {}
ParsedHtml :
RawContentLength : 290
参考