KissPeter / APIFuzzer

Fuzz test your application using your OpenAPI or Swagger API definition without coding
GNU General Public License v3.0
416 stars 65 forks source link

How to use --header correctly? #72

Closed henning410 closed 1 month ago

henning410 commented 3 months ago

I try to use the option --header in docker run. However, I always get error messages like:

APIFuzzer: error: argument --headers: ('%s is not JSON', '[{"Authorization":')

I tried different formats such as: --headers {"Authorization": 'Bearer 1234'}

--headers {"Authorization": "Bearer 1234"}

--headers [{"Authorization": "Bearer 1234"}]

--headers '{"Authorization": "Bearer 1234"}'

--headers '[{"Authorization": "Bearer 1234"}]'

but always get some error message. Can you tell my how to do this correctly? Maybe you can add some example to your README

KissPeter commented 1 month ago

Hi https://github.com/KissPeter/APIFuzzer/blob/master/README.md#quick-start contains an example: --headers HEADERS Http request headers added to all request. Example: '[{"Authorization": "SuperSecret"}, {"Auth2": "asd"}]' This looks good to me: --headers '[{"Authorization": "Bearer 1234"}]'

KissPeter commented 1 month ago

If this is only in Docker, you might want to check https://github.com/KissPeter/APIFuzzer/issues/64