小编mat*_*_io的帖子

Nginx url 限制 502 网关

我有一个问题,但我接受其他绕过此功能的建议。

基本上,我在 get 请求中向我的服务器发送大约 3000 个字符的大行文本,然后服务器将其发送给谷歌翻译作为 url 中的参数。

问题:当 url > 1900 个字符时,Nginx 向我抛出 502 bad gateway 错误。

如何增加我的 nginx url 的限制?

替代解决方案:使用 JSON 中的 3000 个字符作为字符串发送 post 请求?

nginx amazon-ec2 amazon-web-services

6
推荐指数
2
解决办法
7777
查看次数

在 Java 方法中省略 public 修饰符

我正在学习 Java,有一些事情困扰着我,教科书没有解释它。

我知道您使用修饰符来声明类和所有内部的方法。但我突然上了一堂课,宣布像

static void(){
}
Run Code Online (Sandbox Code Playgroud)

为什么没有 public 或 private 修饰符,它仍然有效?我可以避免在其他地方使用 public 修饰符吗,或者它是如何工作的?我知道静态意味着该类的成员,而它不返回值则表示无效。然而,为什么不是公共或私人的。

java methods class subroutine

5
推荐指数
1
解决办法
8578
查看次数

当从文件中读取时,为什么在`to_i`之上需要`to_s`?

"98"从一个文件中读取一个数字,并尝试将其转换为二进制文件input.to_i(2),但我得到了0这种方式.

input=File.read("input.dat")
puts "Input is: #{input}"
puts "Normal way is #{input.to_i(2)}"
puts "It works this way #{input.to_i.to_s(2)}"
puts "Calling the number directly works #{98.to_s(2)}"
Run Code Online (Sandbox Code Playgroud)

输出是:

Input is: 98
Normal way is 0
It works this way 1100010
Calling the number directly works 1100010
Run Code Online (Sandbox Code Playgroud)

ruby string

5
推荐指数
1
解决办法
194
查看次数