如何将复杂的Cookie传递给Ab进行测试? [英] How do I pass a complex cookie to ab for testing?

查看:170
本文介绍了如何将复杂的Cookie传递给Ab进行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ab来测试我的应用,但是我无法传递正确的cookie.我的Cookie数据如下所示:

I'm using ab to test my app, and I'm having trouble passing the correct cookie. My cookie data looks like this:

messages=95925d68c34fcc68b3fcc2e5061a45278c35af41$[[\\\\"__json_message\\\\"\\\\05420\\\\054\\\\"Data\\\\"]]

我不知道如何将字符串的第二部分发送到ab以发送到我的服务器.我正在做类似的事情

I can't figure out how to get the second part of the string to ab to send to my server. I'm doing something like

ab -C messages='95*snip*5af41$[[\\\\"__json_message\\\\"\\\\05420\\\\054\\\\"Data\\\\"]]' http://example.com:80/

[之前的所有内容都已发送,但此后什么都没有发送.我担心[是对我的shell的某种控制,该控制将被转义,但是我不确定这是什么.我认为单引号应该允许我在其中加上除其他单引号之外的任何内容.

Everything up to the [ is sent, but nothing from there on. I'm concerned [ is some kind of control to my shell that is getting escaped, but I'm not quite sure what the deal is. I thought the single quotes should allow me to put anything but another single quote inside of them.

推荐答案

我知道了.原来正确的语法是:

I figured it out. Turns out the correct syntax is:

ab -C 'messages="93bad4084536e6ee5839de07d59c8a42eadf014f$[[\"__json_message\"\05420\054\"Houston3\"]]"' http://localhost:8000/

这篇关于如何将复杂的Cookie传递给Ab进行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆