I've created a flow that allows me to start the AirDroid server through an HTTP Request like 192.168.0.xx/airdroid, and than responds to the client with a redirect instruction pointing to the effective AirDroid server, 192.168.0.XX:8888.
Actually I have to use an html meta refresh tag but it isn't a good solution.
Can you add the possibility to set customized HTTP headers?
Add Header on HTTP Response Text
Moderator: Martin
Re: Add Header on HTTP Response Text
I can add this to the todo-list.
What kind of headers would you like to set in the HTTP request?
What kind of headers would you like to set in the HTTP request?
Re: Add Header on HTTP Response Text
Can you design this new feature in a way that allows to add infinite and customized headers?
I imagine that with a textarea space when I can write some things like:
I imagine that with a textarea space when I can write some things like:
So if anyone in the future needs some special header can set it. It's a bad idea?Header-1: value
Header-2: value
Header-3: etc...
Re: Add Header on HTTP Response Text
Sure, it's a good idea to allow arbitrary headers. For me it's also interesting to know what you specifically want to do with the new feature so I don't miss anything important. Do you want to add a header with a text value or a header that needs a special encoding like Base64?
Perhaps I've misread your initial post, do you want to set the headers in an action HTTP Request or in a HTTP response written with action Write HTTP Response Text/File?
Perhaps I've misread your initial post, do you want to set the headers in an action HTTP Request or in a HTTP response written with action Write HTTP Response Text/File?
Re: Add Header on HTTP Response Text
I haven't the enecessity of use a base64 value. In the Write HTTP Response Text/File, but howeaver if isn't too hard to implement you can add this feature also in all HTTP like requests/reponses.
Re: Add Header on HTTP Response Text
You can use function setHTTPResponseHeader in a script to add a custom header to a response before the actual response is sent with action Write HTTP Response Text/File:
-trigger HTTP Request: /automagic/*, port 8080
-action Script: setHTTPResponseHeader("headername", "value1")
-action Write HTTP Response Text: <html>...
I've added it to the todo-list to also add custom headers to request.
-trigger HTTP Request: /automagic/*, port 8080
-action Script: setHTTPResponseHeader("headername", "value1")
-action Write HTTP Response Text: <html>...
I've added it to the todo-list to also add custom headers to request.
Re: Add Header on HTTP Response Text
You are the best, thank you!