How to access *incoming* headers in Sinatra?

前端 未结 1 689
悲哀的现实
悲哀的现实 2021-01-14 16:35

I\'m sending a request to a Sinatra application by this:

curl -X POST --header \"MyHeader: 123444\" http://localhost:9292/test -d \"\"

How

1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 17:06

    Have you tried adding HTTP to the header name? So it would be request.env["HTTP_ MyHeader"] This is part of the rack spec.

    0 讨论(0)
提交回复
热议问题