Greetings,
I try use CORONA + FLIGHT PHP.
I test with other methos, work fine.
When I always teste with POST, FLIGHT return method: GET.
This is a correct place to post this doubt?
Best regards.
index.php
\<?php require 'flight/Flight.php'; Flight::route('/', function(){ $oo = new StdClass; $oo-\>hello = "Hello World!"; $oo-\>request = Flight::request(); echo json\_encode ( $oo ) ; }); Flight::start();
#1 Test whit PUT
network.request( "http://localhost/corona", "PUT", networkListener )
#1 Return
10:58:18.729 networkListener.Ok 10:58:18.729 table: 03A06508 { 10:58:18.729 [hello] =\> "Hello World!" 10:58:18.729 [request] =\> table: 03A06508 { 10:58:18.729 [proxy\_ip] =\> "" 10:58:18.729 [referrer] =\> "" 10:58:18.729 [data] =\> table: 03A06580 { 10:58:18.729 } 10:58:18.729 [ip] =\> "::1" 10:58:18.729 [host] =\> "localhost" 10:58:18.729 [query] =\> table: 03A06580 { 10:58:18.729 } 10:58:18.729 [url] =\> "/" 10:58:18.729 [base] =\> "/corona" 10:58:18.729 [type] =\> "" 10:58:18.729 [method] =\> "PUT" 10:58:18.729 [accept] =\> "" 10:58:18.729 [user\_agent] =\> "" 10:58:18.729 [secure] =\> false 10:58:18.729 [cookies] =\> table: 03A06580 { 10:58:18.729 } 10:58:18.729 [scheme] =\> "http" 10:58:18.729 [files] =\> table: 03A06580 { 10:58:18.729 } 10:58:18.729 [length] =\> "0" 10:58:18.729 [ajax] =\> false 10:58:18.729 } 10:58:18.729 }
#2 Test with GET
network.request( "http://localhost/corona", "GET", networkListener )
Return
11:04:20.421 networkListener.Ok 11:04:20.421 table: 0A1E74F0 { 11:04:20.421 [hello] =\> "Hello World!" 11:04:20.421 [request] =\> table: 0A1E74F0 { 11:04:20.421 [proxy\_ip] =\> "" 11:04:20.421 [referrer] =\> "" 11:04:20.421 [data] =\> table: 0A1E75B8 { 11:04:20.421 } 11:04:20.421 [ip] =\> "::1" 11:04:20.421 [host] =\> "localhost" 11:04:20.421 [query] =\> table: 0A1E75B8 { 11:04:20.421 } 11:04:20.421 [url] =\> "/" 11:04:20.421 [base] =\> "/corona 11:04:20.421 [type] =\> "" 11:04:20.421 [method] =\> "GET" 11:04:20.421 [accept] =\> "" 11:04:20.421 [user\_agent] =\> "" 11:04:20.421 [secure] =\> false 11:04:20.421 [cookies] =\> table: 0A1E75B8 { 11:04:20.421 } 11:04:20.421 [scheme] =\> "http" 11:04:20.421 [files] =\> table: 0A1E75B8 { 11:04:20.421 } 11:04:20.421 [length] =\> 0 11:04:20.421 [ajax] =\> false 11:04:20.421 } 11:04:20.421 }
#Test with POST
network.request( "http://localhost/corona/ruth", "POST", networkListener )
#Return
11:06:02.494 networkListener.Ok 11:06:02.494 table: 0A3BF5B8 { 11:06:02.494 [hello] =\> "Hello World!" 11:06:02.494 [request] =\> table: 0A3BF5B8 { 11:06:02.494 [proxy\_ip] =\> "" 11:06:02.494 [referrer] =\> "" 11:06:02.494 [data] =\> table: 0A3BF6A8 { 11:06:02.494 } 11:06:02.494 [ip] =\> "::1" 11:06:02.494 [host] =\> "localhost" 11:06:02.494 [query] =\> table: 0A3BF6A8 { 11:06:02.494 } 11:06:02.494 [url] =\> "/" 11:06:02.494 [base] =\> "/corona" 11:06:02.494 [type] =\> "" 11:06:02.494 [method] =\> "GET" 11:06:02.494 [accept] =\> "" 11:06:02.494 [user\_agent] =\> "" 11:06:02.494 [secure] =\> false 11:06:02.494 [cookies] =\> table: 0A3BF6A8 { 11:06:02.494 } 11:06:02.494 [scheme] =\> "http" 11:06:02.494 [files] =\> table: 0A3BF6A8 { 11:06:02.494 } 11:06:02.494 [length] =\> 0 11:06:02.494 [ajax] =\> false 11:06:02.494 } 11:06:02.494 }