Giter Site home page Giter Site logo

QD清空日志 评论区 about templates HOT 2 OPEN

zyblog123 avatar zyblog123 commented on June 21, 2024
QD清空日志 评论区

from templates.

Comments (2)

a76yyyy avatar a76yyyy commented on June 21, 2024

可以使用 {{ host | default("127.0.0.1") }} 作为含默认值的变量

from templates.

zyblog123 avatar zyblog123 commented on June 21, 2024

可以使用 {{ host | default("127.0.0.1") }} 作为含默认值的变量

试过了,没有成功,会报错,而且编辑那一条时 Request URL 中的 {{ host | default("127.0.0.1") }} 会自动被URL编码,就没有再试了。HAR模板内容如下

[{"request":{"method":"POST","url":"http://{{host | default(\"127.0.0.1\")}}:{{port}}/login","headers":[{"name":"Accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"},{"name":"Accept-Encoding","value":"gzip, deflate"},{"name":"Accept-Language","value":"zh-CN,zh;q=0.9"},{"name":"Cache-Control","value":"max-age=0"},{"name":"Connection","value":"keep-alive"},{"name":"Content-Length","value":"45"},{"name":"Content-Type","value":"application/x-www-form-urlencoded"},{"name":"Host","value":"{{host | default(\"127.0.0.1\")}}:{{port}}"},{"name":"Origin","value":"http://{{host | default(\"127.0.0.1\")}}:{{port}}"},{"name":"Referer","value":"http://{{host | default(\"127.0.0.1\")}}:{{port}}/login"},{"name":"Upgrade-Insecure-Requests","value":"1"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"}],"cookies":[],"data":"email={{email|urlencode}}&password={{password|urlencode}}","mimeType":"application/x-www-form-urlencoded"},"rule":{"success_asserts":[{"re":"302","from":"status"}],"failed_asserts":[{"re":"请输入用户名和密码","from":"content"}],"extract_variables":[{"name":"cookie","re":"Set-Cookie: (.*?); expires","from":"header"}]}}]

from templates.

Related Issues (20)

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.