http-bridge

command module
v0.0.0-...-248bc2f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

http-bridge

介绍

golang 实现的远程数据接口代理服务

特点

  • golang实现,轻量、高效率
  • 让不支持跨域的远程数据接口支持跨域
  • 方便未备案(小程序等)、不支持http是接口支持
  • 支持自定义header

使用

http://127.0.0.1:4455/?url=https://www.mxnzp.com/api/image/girl/list?page=1&headers={"token":"1284034","deviceId":"104drldu34","appId":"1453"}

  • 支持方法 GET POST DELETE PUT
  • url 即为需要代理的请求地址
  • headers 自定义header 这里只是为了好看,实际要对header进行encode
自定义headers
  1. 将自定义headers写在请求头里
customHeaderKey1: customHeaderVal1
customHeaderKey2: customHeaderVal2
  1. 将自定义headers作为参数发送

headers={"token":"1284034","deviceId":"104drldu34","appId":"1453"}

请求参数名为```headers`` 其中kv 必须为字符串 实际要对header进行encode

Xshot-0023.png

说明

响应头中x-request-time表示响应时长 毫秒

License

http-bridge is licensed under the Apache License, Version 2.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL