dtslobe4694 2017-04-13 13:19
浏览 713
已采纳

Golang发送http请求发送两次而不是一次

I am trying to do simple http post request using the following code: Golang code from another SO post

It's sending the http request twice (I tried both to my own web service and also to the Firebase messaging server). Anyone have any idea of what's wrong? Thank you.

Edit Ignore me, figured out it's the AVG anti virus causing the problem. If I do:go run program.go then hit enter just once, AVG interrupts saying it has scan it and then let it run. This results in the http call twice. If I disable antivirus before running, then the http requrest is received only once on the other side. I've switched the antivirus on and off a few times to confirm this is the cause.

  • 写回答

1条回答 默认 最新

  • dongnaoxia0927 2017-04-14 14:11
    关注

    As in my edit, the cause was AVG anti virus. There was nothing in the console log indicating any part of the program was run twice. Not sure why the downvotes, I spend a few hours on this, move from Firebase messaging server to my own webserver to remove external dependency, and even read the source in net/http package.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?