Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route not working? #91

Open
concentrateddon opened this issue Nov 28, 2022 · 0 comments
Open

Route not working? #91

concentrateddon opened this issue Nov 28, 2022 · 0 comments

Comments

@concentrateddon
Copy link

I've defined the following:

@WebRoute(GET, '/writedevice/<mac>/<target>')
def handleWriteDevice(microWebSrv2, request, args) :
    print()
    print('Writing device',args['mac'],'to',args['target'])
    WriteDevice(args['mac'],args['target'])
    request.Response.ReturnOk()

Upon running the project, I can see that the route is registered:

 + [@WebRoute] GET /writedevice/<mac>/<target>

There are no other routes using /writedevice:

Creating WWW routes
 + [@WebRoute] GET /
 + [@WebRoute] GET /getdevicelist
 + [@WebRoute] GET /getschedule
 + [@WebRoute] GET /addschedule/<mac>/<abovebelow>/<light>/<target>
 + [@WebRoute] GET /deleteschedule/<id>
 + [@WebRoute] GET /testlight
 + [@WebRoute] GET /writedevice/<mac>/<target>

However, an incoming request isn't picked up:

WWW: From 192.168.68.81:53110 GET /writedevice/34ab958f6ed40004/100 >> [307] Temporary Redirect

Any suggestions? I feel like I must be doing something wrong with the arguments bit of it, but I can't figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant