Go Down

Topic: Getting the full URL and args out of ESP8266WebServer (Read 170 times) previous topic - next topic

cjcharles

So hopefully a quick question... Ive been going through the ESP8266WebServer documentation to find a way of getting the full request string (from a client), but havent found anything.

If somebody calls IP_ADDRESS/directory?var1=abc&var2=def then I want to get the /directory?var1=abc&var2=def part which I assume would already exist somewhere (I need to pass it on to another device).

Seemingly I will have to do this by combining the uri() call with a loop (0 >= i <= args()) through all argName(i) and arg(i). Can I ask somebody to sanity check my interpretation of the documentation please!

Thank you very much!

PaulS

Quote
Can I ask somebody to sanity check my interpretation of the documentation please!
What documentation? The name of the library is only marginally important. The URL of the library s vitally important.
The art of getting good answers lies in asking good questions.

cjcharles

This one - https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer

Thanks

PaulS

What does YOUR code look like? You must have one or more calls on the on() method. The functions linked in the on() call can call uri() to get the URL.
The art of getting good answers lies in asking good questions.

cjcharles

Yup, I have plenty of on() calls for various different URIs, and within each there is a bunch of processing of the args to do various things.

I was hoping to add in one command that pulls the uri+args and forwards them to another IP address, so that I can either duplicate the device, or log it. Hence would ideally be able to just take the string of the full request, as opposed to re-assembling it.

I understand the desire to have the full code to aid your understanding, but there are several thousand lines of code, hence thought summarising it into the usage of the functions was easiest. I think I was just assuming that the entire request string must have existed and hence could be retrieved easily through a particular function, but perhaps it is immediately processed into the uri/argName/arg functions.

Go Up