1
私は{key, value}
のようなタプルを持つphoenix req_headers
リストを持っています。タプルの値をリストから取得するにはどうすればよいですか?そのような:どのようにリストから値の1つでタプルを取得できますか?
[{"host", "localhost:4000"}, {"user-agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"}, {"accept", "application/json, text/plain, */*"}, {"accept-language", "en-US,en;q=0.5"}, {"accept-encoding", "gzip, deflate"}, {"content-type", "application/json;charset=utf-8"}, {"referer", "http://localhost:4000/"}, {"content-length", "16"}, {"connection", "keep-alive"}]
そして私は「http://localhost:4000」であるキー「ホスト」の値を取得したいです。どうやってやるの?