0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【FastAPI】Failed to execute 'fetch' on 'Window' / String contains non ISO-8859-1 code point. エラーの原因と解決方法

Posted at

エラー内容

  • FastAPIを使ってAPIのリクエスト・レスポンスのテストをしていたら、以下のエラーメッセージが返ってきた。
TypeError: Failed to execute 'fetch' on 'Window': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.
  • FastAPIとは:PythonでRESTful APIを開発するためのWebフレームワーク

原因

  • リクエストヘッダーの中にnon ISO-8859-1 code point、つまり日本語が入っていた。
  • ISO 8859-1とは、ラテンアルファベットの文字コード標準。西欧系の言語なので、日本語には対応していない。
    *ISO 8859-1の詳細についてはこちら: ISO/IEC 8859【ISO 8859】ISO 8859-1

解決方法

  • リクエストヘッダーから日本語をなくしたら、このエラーはなくなりました!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?