Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

[Q] Help port from me-no-dev to this repo - getparam() need different data #117

Description

@softwarecrash

hello and thank you for this project,
i switched from the me-no-dev espasyncwebser to this, so i ran into a issue with the getparam

here is the little function, it is for setting different variables over web adress, here a short version

server.on("/set", HTTP_GET, [](AsyncWebServerRequest *request)
            {
    AsyncWebParameter *p = request->getParam(0);
    if (p->name() == "sw1")
    {
      if(p->value().toInt() == 1){
       switch1 = true
      }
      if(p->value().toInt() == 0){
       switch1 = false
      }
   }
    if (p->name() == "sw2")
    {
      if(p->value().toInt() == 1){
       switch2 = true
      }
      if(p->value().toInt() == 0){
       switch2 = false
      }
   }

with
http://<DEVICE_IP>/set?sw1=0

so i get the error

src\main.cpp:512:49: error: call of overloaded 'getParam(int)' is ambiguous
  512 |       AsyncWebParameter *p = request->getParam(0);
      |                                                 ^

how can i solve this?

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions