3
3

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 5 years have passed since last update.

HTTPでリターンコードが0になる

Posted at

mbedでHTTPClient_HelloWorldを試してみたところ、サンプルは動くがこれを自分のサイトなどに変えてみるとエラーになる。
しかもHTTP Responseが0という謎の値で、どうやら宛先に到達できていない模様。

うーんおかしい、ということでHTTPClientのなかみを見てみると驚愕の事実が。。。

  char host[32];
  char path[64];

なんと、ホスト名は32byte、その先のパスは64byteまででないとNGになっていたのだ(コラッ)。これを拡張したところ、うまく動くようになったという。

こんなのを見るとCをこの世から駆逐してやりたい気持ちでいっぱいになる。C++ベース(std)で自分で書き直したほうがいいような気も。。。

3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?