简体   繁体   English

perl:不向浏览器返回任何内容

[英]perl: return no content back to browser

I'm passing a url (from javascript) to a perl script. 我正在将URL(从javascript)传递到perl脚本。 The perl script gets data back from the URL, processes it and writes a file. perl脚本从URL取回数据,对其进行处理并写入文件。 That's all working fine. 一切都很好。

At this point all I want to return processing to the browser/javascript but I'm struggling to prevent the perl script from returning content to the browser. 在这一点上,我只想将处理返回到浏览器/ javascript,但是我在努力防止perl脚本将内容返回到浏览器。 It just blanks the page. 它只是空白页面。

I suspect it's the content type/header that's causing the issue but can't seem to find a way to inhibit it returning something the browser wants to display. 我怀疑是导致问题的原因是内容类型/标题,但似乎找不到办法阻止它返回浏览器想要显示的内容。

So far after much hunting I came across 到目前为止,经过很多狩猎,我遇到了

print "Status: 204 No Content\n\n";

Looked promising but I suspect just having the print command is enough to push something back at the browser. 看起来很有希望,但我怀疑仅使用print命令就足以将某些内容推回浏览器。

Any pointers appreciated. 任何指针表示赞赏。 I can't be the only person that just wants perl to go off and do a job without returning content. 我不能是唯一想要perl不做任何事情而不返回内容的人。

必须对请求做出响应,“ 204 No Content” 某些内容推回浏览器:没有内容可显示的信息(因此浏览器将继续显示先前的内容)。

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

相关问题 返回点击返回浏览器操作 - Return on click back browser action 如何处理浏览器后退按钮以获取动态内容 - How to handle browser back button for dynamic content 在浏览器中捕获“返回”事件并加载不同的内容 - Catch “Back” event in browser and load different content 在浏览器中按后退或前进按钮时,URL会更改,但内容不会更改 - On back or forward button press in a browser the URL changes but the content does not 调整浏览器大小时,平滑的滑块内容不会恢复 - Slick Slider content wont snap back when resizing browser 如何在Vue cli中的浏览器后退按钮上进行分页和内容呈现? - How to make pagination and content render on browser back button in Vue cli? 带有ajax内容的页面在浏览器后退按钮后不记得状态 - Page with ajax content does not remember a state after browser back button 处理动态内容的浏览器后退按钮的最佳方法是什么? - What is the best way to handle browser back button for dynamic content? 将内容加载到iframe中后,浏览器后退按钮不起作用 - Browser back button doesn't work when content is loaded into an iframe 如何在不返回浏览器的情况下使用JavaScript返回到先前的路线? - How to return to previous route using JavaScript without going back in the browser?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM