Skip to content

sending 2 requests with "if" #7703

Closed Answered by princechaddha
rawezh80 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Rawezho1o, For your specific scenario, you can write a template like this:

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

      - |
        @Host: https://googlekey.blindf.com
        GET /?token={{token}} HTTP/1.1
        Host: googlekey.blindf.com

    matchers-condition: and
    matchers:

      - type: word
        part: body
        words:
          - "test"

    extractors:
      - type: regex
        name: token
        internal: true
        group: 1
        regex:
          - '<token>(.*)</token>'

The second request will be sent only once the key has been extracted.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rawezh80
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants