I’ve been experimenting with SoftAP recently and have just tried what you describe and am getting the same effect.
A POST with Content-Type: text/plain doesn’t invoke the page handler. I’ve got a Serial.print at the top of the handler and it doesn’t show anything. I’ve been using Wireshark to see what goes back and forth from my laptop, and can see that the Photon SoftAP does send a 404 but the browser doesn’t recognise it. I wonder whether it’s because the http response hasn’t got a content-length or chunked length of zero so the browser hangs.
This is what I’m seeing on the hanging request/response:
POST /colour HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1;
WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://192.168.0.1/colourformplain
Connection: keep-alive
Content-Type: text/plain
Content-Length: 15
color=#966432
HTTP/1.1 404 Not Found
Content-Type: text/html
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: Keep-Alive
If I request a page that doesn’t exist using a GET I get this (which works properly):
GET /sdfsfsdfsdfsfd HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1;
WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
HTTP/1.1 404 Not Found
X-MYHEADER: testing123bad
Content-Type: text/plain
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: Keep-Alive
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
18
Error 404 Page Not Found
0
The difference here is that my page handler has been invoked. I customised it to add my own header and some friendly text.
If I remove my customisations I get this (which works properly):
GET /sdfsdfsdfsdfsdfsdf HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
HTTP/1.1 404 Not Found
Content-Type: text/plain
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: Keep-Alive
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
0
So the two that work correctly both send something that indicates to the browser what to expect in the way of a response body.
Of course, this doesn’t solve your problem, however you might want to reconsider using application/x-www-form-urlencoded because text/plain sends the colour string as “color=#966432” (see first example above) so even if you get text/plain working you’re still faced with decoding a hex string