Giter Site home page Giter Site logo

apipost-team / apipost-tools Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 84 KB

apipost-tools 是一个一致性、模块化、高性能的 JavaScript 实用工具库。

Home Page: https://www.npmjs.com/package/apipost-tools

License: MIT License

JavaScript 4.26% TypeScript 95.74%

apipost-tools's People

Contributors

kuwooo avatar trqdz avatar xbw19975 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

csdaa

apipost-tools's Issues

[请求]json修复工具

可否在美化图标旁边,加一个 json修复工具?就像 这个网站 做的一样:

{ code: 401, msg: 'failed' } 会修复为 {"code":401,"msg":"failed"}

方便直接从js代码中复制 object 到 apipost 中做测试。

请问如何实现像apipost的websocket接口测试一样添加自定义请求头

我现在有一个需求,需要在websocket开启连接发送http请求握手的时候携带上token校验数据(因为项目使用springsecurity做了鉴权,所有需要jwt鉴权的请求应该都要走那个jwt过滤器,我不希望为websocket再额外做处理)

我查阅了很多资料都是说websocket无法添加自定义请求头,只有说通过设置子协议'sec-websocket-protol'曲线救国,我在前端使用设置这个子协议,就是直接把header"sec-websocket-protol"的值设置为token,这样我需要在jwt过滤器判断一下为这个websocket请求做单独判断,我并不希望这样做。

我的前端创建websocket请求如下
2023-06-14_122228
我的后端接收到的请求头如下
2023-06-14_122422
然后我使用apipost的websocket接口测试,发现里面可以直接设置请求头,并且对应后就直接是我需要的header,而不是在sec-websocket-protol那里面

例如在apipost中这样设置
2023-06-14_122517
对于apipost发送的ws请求,后端接收到的请求头是很完美的
2023-06-14_122659
我希望我在前端创建websocket请求并发送的时候,请求头是和apipost所实现的效果是一样的,所以就很想请教一下官方这部分是怎么实现的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.