Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST request params issue #1

Open
denisefan28 opened this issue Oct 24, 2017 · 2 comments
Open

POST request params issue #1

denisefan28 opened this issue Oct 24, 2017 · 2 comments

Comments

@denisefan28
Copy link

Dear byorty, your testing tool looks awesome, it doesn't go wrong until I change my config file to a POST request with params. I checked those requests send from mgun, they turn out to be empty requests. Do you known how to fix this?
Many thanks!

@oliversalzburg
Copy link

Weird, I was just about to ask a question about POST params myself :D I'm trying to POST a JSON payload, but I'm unclear on how to get mgun to do it.

@denisefan28
Copy link
Author

denisefan28 commented Oct 25, 2017

I tried something similar to config.yaml, still not working ...

concurrency: 1
loopCount: 1
scheme: http
host: 127.0.0.1
port: 8000
debug: True
params:
  search:
    languages: [php, java, c++, c, go, golang, js]
    structures: [for, while, class, if, else, case]
  agent:
    - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36 FirePHP/4Chrome
    - Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
    - Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0
    - Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0
  say: hello world

  session:
    - login: user1
      password: password1
      friendIds: [1, 2, 3, 4]
    - login: user2
      password: password2
      friendIds: [5, 6, 7, 8]
requests:
  - POST: /index
    param:
      friend_id: ${session.friendIds}
      say: ${say}

and my server side is

from flask import Flask, request
import simplejson
app = Flask(__name__)
@app.route('/index', methods=['POST'])
def test_api():
    print(request.form)
    return simplejson.dumps({"status":"success"})
if __name__ == '__main__':
    app.run(host='0.0.0.0',port=8000)

byorty pushed a commit that referenced this issue Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants