LoginSignup
0
0

More than 5 years have passed since last update.

telnetを使ってサーバーにxhrを送信してみよう

Posted at

はじめに

サーバーサイドを実装して、その動作を確認するためにxhrを送信したい場合がありました。telnetを使ってみました。

この記事ではサーバーサイドの実装は紹介しません。telnetを使ってサーバーにxhrを送信する方法を紹介します。

telnetを使ってサーバーにxhrを送信する方法

まず、サーバーサイドを実装して、サーバーを起動しておきます。

次に、telnetでそのサーバーと通信します。

$ telnet localhost 4690

GET / HTTP/1.1
Host: localhost
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded;charset=UTF-8

telnetでHTTPリクエストを送信するのとほとんど変わりませんね。

まとめ

できそうだと思ったので、試してみました。もう少し便利なものが欲しいですね。

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