Guest User

Untitled

a guest
Sep 22nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. this.httpClient.post(
  2. this.url+'categorias/insertar',
  3. {
  4. "json": [
  5. {
  6. "nombre": this.categoria.nombre,
  7. }
  8. ]
  9. })
  10. .subscribe(
  11. data => {
  12. console.log("POST Request is successful ", data);
  13. },
  14. error => {
  15. console.log("Error", error);
  16. }
  17. );
  18.  
  19. $app->post('/categorias/insertar', function() use($db, $app){
  20. $json = $app->request->post('json');
  21. $data = json_decode($json, true);
  22. echo json_encode($data);
  23. });
  24.  
  25. object(SlimHttpRequest)[43]
  26. protected 'env' =>
  27. object(SlimEnvironment)[37]
  28. protected 'properties' =>
  29. array (size=22)
  30. 'REQUEST_METHOD' => string 'POST' (length=4)
  31. 'REMOTE_ADDR' => string '::1' (length=3)
  32. 'SCRIPT_NAME' => string '/webapp-backend/index.php' (length=25)
  33. 'PATH_INFO' => string '/categorias/insertar' (length=20)
  34. 'QUERY_STRING' => string '' (length=0)
  35. 'SERVER_NAME' => string 'localhost' (length=9)
  36. 'SERVER_PORT' => string '80' (length=2)
  37. 'HTTP_HOST' => string 'localhost' (length=9)
  38. 'HTTP_CONNECTION' => string 'keep-alive' (length=10)
  39. 'CONTENT_LENGTH' => string '28' (length=2)
  40. 'HTTP_ACCEPT' => string 'application/json, text/plain, */*' (length=33)
  41. 'HTTP_ORIGIN' => string 'http://localhost:4200' (length=21)
  42. 'HTTP_USER_AGENT' => string 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' (length=114)
  43. 'CONTENT_TYPE' => string 'application/json' (length=16)
  44. 'HTTP_REFERER' => string 'http://localhost:4200/categoria' (length=31)
  45. 'HTTP_ACCEPT_ENCODING' => string 'gzip, deflate, br' (length=17)
  46. 'HTTP_ACCEPT_LANGUAGE' => string 'es-419,es;q=0.9' (length=15)
  47. 'slim.url_scheme' => string 'http' (length=4)
  48. 'slim.input' => string '{"json":[{"nombre":"asda"}]}' (length=28)
  49. 'slim.errors' => resource(24, stream)
  50. 'slim.request.form_hash' =>
  51. array (size=0)
  52. ...
  53. 'slim.flash' =>
  54. object(SlimMiddlewareFlash)[19]
  55. ...
  56. public 'headers' =>
  57. object(SlimHttpHeaders)[44]
  58. protected 'data' =>
  59. array (size=10)
  60. 'Host' => string 'localhost' (length=9)
  61. 'Connection' => string 'keep-alive' (length=10)
  62. 'Content-Length' => string '28' (length=2)
  63. 'Accept' => string 'application/json, text/plain, */*' (length=33)
  64. 'Origin' => string 'http://localhost:4200' (length=21)
  65. 'User-Agent' => string 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' (length=114)
  66. 'Content-Type' => string 'application/json' (length=16)
  67. 'Referer' => string 'http://localhost:4200/categoria' (length=31)
  68. 'Accept-Encoding' => string 'gzip, deflate, br' (length=17)
  69. 'Accept-Language' => string 'es-419,es;q=0.9' (length=15)
  70. public 'cookies' =>
  71. object(SlimHelperSet)[46]
  72. protected 'data' =>
  73. array (size=0)
  74. empty
Add Comment
Please, Sign In to add comment