dsxay48646 2019-02-21 06:59
浏览 395

如何将golang之类的http响应状态文本更改为200 OK到200 {Custom text}

I want to change the response text for the given status code in GO. how to do it.

Currently the status text for some popular status code is like this: 200 -> OK 404 -> NOT FOUND 201 -> CREATED

I want to change the text with my message like 200 -> {MY CUSTOM MESSAGE}

  • 写回答

2条回答 默认 最新

  • douchen4915 2019-02-21 07:47
    关注

    If you really want to change the response, you could use net package of golang and implement your own HTTP-like protocol instead of using net/http.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度