简体   繁体   English

在Rails中解析HTTPS而不是HTTP

[英]Parsing HTTPS instead of HTTP in Rails

I know how to parse HTTP requrests using Net::HTTP. 我知道如何使用Net :: HTTP解析HTTP requrest。 How do you parse HTTPS requests? 您如何解析HTTPS请求?

I've tried and it says as a response (one of the lines): 我已经尝试过了,它的回答是(其中一条):

<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>

stox STOX

Edited: 编辑:

So to show you in a little bit more detail: 因此,向您展示更多细节:

For example, here is the HTTP API 例如,这是HTTP API

https://xxxxx.info/merchant/balance?password=$main_password

How do I use Net:http to run this? 我如何使用Net:http来运行它? Or do I use something else? 还是我使用其他东西?

Thanks Stox 谢谢斯托克斯

would be helpful if you showed us some code? 如果您向我们展示了一些代码,会有所帮助吗?

try setting these attributes 尝试设置这些属性

# assuming http is generated like this http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
# might need this as well? 
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM