rest - Paw returns wrong web page compared to browsers -


the requests appear sent wrong host (not entirely sure host they're being sent response can sent 4 different servers).

chrome returns right json response:

chrome returns valid json

paw's nsurlconnection library :

enter image description here

but default paw http library returns 404 not found :

enter image description here

you have 2 local servers listening on port 8000, 1 listens ipv6 connections (note: it's default php apps) , 1 listening ipv4 connections.

when connect "localhost" don't specify ip protocol want use, , sounds clients (including chrome, asihttprequest , nsurlconnection in paw) choose connect ipv6 first. whereas paw http library chooses connect ipv4 (we made choice ipv4 still used, , wanted avoid bugs as possible).

so when run main web app specifying localhost:8000 server (php in case) listens [::1]:8000 (which ipv6 equivalent 127.0.0.1:8000), , guess other server listens actual ipv4 127.0.0.1:8000. chrome , other libraries connect [::1]:8000 (ipv6) , main php application, whereas "paw http library" connect 127.0.0.1:8000 (ipv4) hits other server, returns 404 can see in video.

what need specify actual ip instead of localhost. use http://[::1]:8000/plans connect main app listens ipv6.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -