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

New --data option question #12

Closed
mjablecnik opened this issue Sep 18, 2021 · 6 comments
Closed

New --data option question #12

mjablecnik opened this issue Sep 18, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@mjablecnik
Copy link

Hello @xnbox,
I see that you added a new --data option into DeepfakeHTTP but I didn't found any example of how to use it..
Can you write here some description of this new functionality please? I tried understand it but I am not sure if I understand it right.
Can you write here also some small example? Thank you very much for your work. :-)

@xnbox xnbox added the documentation Improvements or additions to documentation label Sep 18, 2021
@xnbox
Copy link
Owner

xnbox commented Sep 18, 2021

Hi Martin,
The documentation is not ready yet.
Very dirty example:

mydata.json

{
    "id": 28,
    "address" : {
        "city": "AAAA",
        "country": "BBB"
    },
    "kkk": [100, 200, 300, 400, 500, 600, 700]
}
POST /action_page.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded

HTTP/1.1 200 OK
Content-Type: text/html
X-Body-Type: text/template

<!DOCTYPE html>
<html lang="en">
<body>
    <h1>Hello, ${address.city} ${address.country}!</h1> <!-- print: Hello, AAA BBB -->
 ${kkk[1]} <!-- print: 200 -->
 ${kkk[$]} <!-- print: some random value from kkk array -->
</body>
</html>

Thanks for your support!!

@mjablecnik
Copy link
Author

Thank you very much for your response.
I am trying your example but I gain this Error response:
image

Are you sure that you sent me the right working example?

@xnbox
Copy link
Owner

xnbox commented Sep 18, 2021

Oh, I see! Bug here.
Fixed in v1.0.14

@mjablecnik
Copy link
Author

Yes now it works right now. ;-) Is it also possible to add this variables also into request param or request body?
For example:

POST /action_page_${address.city}.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded

And call it as:

curl -X POST http://localhost:3000/action_page_AAAA.php

Then I will can have all values in the separate file and use only variables..

@xnbox
Copy link
Owner

xnbox commented Sep 18, 2021

I think this is a great idea!
Thank you!

@xnbox xnbox added enhancement New feature or request and removed documentation Improvements or additions to documentation labels Sep 18, 2021
@xnbox
Copy link
Owner

xnbox commented Sep 24, 2021

implemented in v1.0,15

@xnbox xnbox closed this as completed Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants