Parsing URL

I'm trying to create a project withe the ESP32 which will allow me to control two pwm lines via wifi. I'm relatively inexperienced when it comes to programming, but eager to learn. Having got an LED to turn on and off with the help of the SimpleWiFiServer sketch, I thought I could try to parse the duty cycle info for the URL. However, it does not seem to work. Below is the relevant section of my code.

        int pwmChannelA = 0;
        if(currentLine.indexOf("pwmchannelA=") != -1 ){                       //we find pwmchannelA
          int aindex = currentLine.indexOf("pwmchannelA=") + 12;              //get to index after =
          String pwmChannelAString = currentLine.substring(aindex);           //typecast number to int
          pwmChannelA = pwmChannelAString.toInt();                            //convert to int
        }
                                                                                
        if(pwmChannelA <100){                                                 //LED off if <100, on otherwise
          digitalWrite(5, LOW);
        }

        if(pwmChannelA >=100){
          digitalWrite(5,HIGH);
        }

However, I get no response. What am I doing wrong here? As my int could be any number of digits from one to three I dont want to explicitly declare indexing values, and in the future I might want to add additional 'tags' for determining the value I'm changing - pwm a, pwm b, etc etc.

Apologies in advance for my noob-ness, any questions I will be happy to answer.

Not a lot that we can tell from that snippet.

A lot depends on what the contents of currentLine are.

Have you tried debugging that particular section?
For example:

  • What are the contents of currentLine going in to that section
  • What does aindex evalute to after currentLine.indexOf
  • What does pwmChannelAString contain after currentLine.substring
  • What is the value of pwmChannelA at the end of the if statement

Do some debugging and work through the above.
If you're still having issues after doing that, post the entire sketch and the results of your debugging

Below is the relevant section of my code.

If you KNOW that that is the relevant section of code, fix it.

It is far more likely that that is NOT the relevant section of the code.

        if(currentLine.indexOf("pwmchannelA=") != -1 ){                       //we find pwmchannelA
          int aindex = currentLine.indexOf("pwmchannelA=") + 12;

Why do you need to hunt for the index of the substring twice?

However, I get no response.

From what? Your dead grandmother?

What am I doing wrong here?

Posting snippets.
Debugging by guessing.