Supereg / homebridge-http-switch

Powerful http switch for Homebridge: https://github.com/homebridge/homebridge
ISC License
219 stars 36 forks source link

Challenges when talking to Python http.server for HTTP POST #25

Closed roncoejr closed 5 years ago

roncoejr commented 5 years ago

Greetings,

First let me say thank you for the creation of such a well thought out solution. I'm certain that my issue is relative to something that I've misunderstood.

I've written a basic server using the Python 3.5 http.server module. This server is configured to respond to GET and POST requests. For testing outside of HomeKit I've written a tool in PHP that successfully demonstrates the intended use of the Python based server. Observing packet captures when the test tools are used reveals that the POST is about 36 bytes in length.

Observing packet captures when attempting to use the homebridge-http-switch reveals that the POST is 0 bytes in length.

I'd be most grateful for your thoughts as to what might be the cause.

Thank you, again.

Packet Capture for http-switch communication: screenshot from 2018-12-30 20-42-09

Packet Capture for test Utility: screenshot from 2018-12-30 20-44-01

Output of the http.server module running my basic Python server: screenshot from 2018-12-30 20-44-45

roncoejr commented 5 years ago

Forgot to attach an image of the output that I see in HomeBridge:

image

roncoejr commented 5 years ago

Probably also useful to see an example of the URLs that I use (note that I have since changed to the 'stateless' switch type and get the same result):

image

roncoejr commented 5 years ago

Disregard. I must have been up too late trying to get this one resolved. Fresh perspective this morning yields progress.

Supereg commented 5 years ago

I didn’t had time to get my head behind your problem. Did you solve your issue? Any further help needed?

roncoejr commented 5 years ago

I didn’t had time to get my head behind your problem. Did you solve your issue? Any further help needed?

No worries at all. I'm making progress. Though, I wonder: should a UrlObj configured as a post request work, or are we limited to GET requests?