optimalstrategy / sms_forwarder_app

An app for forwarding SMS messages
MIT License
55 stars 18 forks source link

Specifying additional HTTP headers #13

Closed bilogic closed 2 years ago

bilogic commented 2 years ago

Hi, possible to enter header Authorization: Bearer <token> when calling a HTTP endpoint?

curl \
    --request POST \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer *************" \
    --data '{"json": "data"}' \
    https://example.com/url
optimalstrategy commented 2 years ago

No, it's not currently possible to specify custom headers, but that's an easy feature to implement. I'll look into this when I get some free time.

bilogic commented 2 years ago

Looking forward to it! Thank you!

optimalstrategy commented 2 years ago

@bilogic Please see the latest release. You can now specify custom HTTP headers similarly to the JSON payload and URI params:

.

bilogic commented 2 years ago

hey man thanks! Already upgraded and testing it.

Seems that a Authorization cannot be updated/removed after it is added. I can update or remove it, but after closing the app and starting it again, the header is back. Any idea?

bilogic commented 2 years ago

Ok, false alarm, I missed the save button. Thank you!

optimalstrategy commented 2 years ago

Yeah, I think it's not obvious that you must press the button in order for the changes to be recorded. Do you think it would be better if the app had autosave?

bilogic commented 2 years ago

@optimalstrategy hmm, given the current UI, I guess what makes more sense is, if the data is dirty, pop up a prompt to save or discard when pressing the back arrow on Http Callback Settings

optimalstrategy commented 2 years ago

@bilogic I like this idea, thank you! I'll open an issue for this one and implement it when I get a chance.