1+ <?php
2+ $ backend = gethostbyname (backend);
3+
4+ $ url = "http:// $ backend:8080 " ;
5+ $ model = $ _REQUEST ['input_name ' ];
6+ $ payload = array (
7+ 'input.name ' => $ model ,
8+ 'input.files ' => $ _REQUEST ['input_files ' ],
9+ 'metaphor ' => $ _REQUEST ['metaphor ' ],
10+ 'city.building_type ' => $ _REQUEST ['city_building_type ' ],
11+ 'city.building_base ' => $ _REQUEST ['city_show_building_base ' ],
12+ 'city.original_building_metric ' => $ _REQUEST ['city_original_building_metric ' ],
13+ 'city.width_min ' => $ _REQUEST ['city_width_min ' ],
14+ 'city.height_min ' => $ _REQUEST ['city_height_min ' ],
15+ 'city.building.horizontal_margin ' => $ _REQUEST ['city_building_horizontal_margin ' ],
16+ 'city.building.horizontal_gap ' => $ _REQUEST ['city_building_horizontal_gap ' ],
17+ 'city.building.vertical_margin ' => $ _REQUEST ['city_building_vertical_margin ' ],
18+ 'city.package.color_start ' => $ _REQUEST ['city_package_color_start ' ],
19+ 'city.package.color_end ' => $ _REQUEST ['city_package_color_end ' ],
20+ 'city.class.color_start ' => $ _REQUEST ['city_class_color_start ' ],
21+ 'city.class.color_end ' => $ _REQUEST ['city_class_color_end ' ],
22+ 'city.class.color ' => $ _REQUEST ['city_class_color ' ]
23+ );
24+
25+ // foreach($parameters as $key => $value) {
26+ // echo "$key = $value";
27+ // echo '</br>';
28+ // }
29+
30+ // use key 'http' even if you send the request to https://...
31+ $ options = array (
32+ 'http ' => array (
33+ 'header ' => "Content-type: application/x-www-form-urlencoded \r\n" ,
34+ 'method ' => 'POST ' ,
35+ 'content ' => http_build_query ($ payload )
36+ )
37+ );
38+ $ context = stream_context_create ($ options );
39+ $ result = file_get_contents ($ url , false , $ context );
40+
41+ // false, because we receive redirect
42+ if ($ result === FALSE ) {
43+ header ("Location: http://localhost:8082/ui/index.php?aframe=true&model= $ model&setup=web_a-frame/default&srcDir=data-gen " );
44+ die ();
45+ }
46+
47+ var_dump ($ result );
48+
49+ ?>
0 commit comments