Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.httpClient.post(
- this.url+'categorias/insertar',
- {
- "json": [
- {
- "nombre": this.categoria.nombre,
- }
- ]
- })
- .subscribe(
- data => {
- console.log("POST Request is successful ", data);
- },
- error => {
- console.log("Error", error);
- }
- );
- $app->post('/categorias/insertar', function() use($db, $app){
- $json = $app->request->post('json');
- $data = json_decode($json, true);
- echo json_encode($data);
- });
- object(SlimHttpRequest)[43]
- protected 'env' =>
- object(SlimEnvironment)[37]
- protected 'properties' =>
- array (size=22)
- 'REQUEST_METHOD' => string 'POST' (length=4)
- 'REMOTE_ADDR' => string '::1' (length=3)
- 'SCRIPT_NAME' => string '/webapp-backend/index.php' (length=25)
- 'PATH_INFO' => string '/categorias/insertar' (length=20)
- 'QUERY_STRING' => string '' (length=0)
- 'SERVER_NAME' => string 'localhost' (length=9)
- 'SERVER_PORT' => string '80' (length=2)
- 'HTTP_HOST' => string 'localhost' (length=9)
- 'HTTP_CONNECTION' => string 'keep-alive' (length=10)
- 'CONTENT_LENGTH' => string '28' (length=2)
- 'HTTP_ACCEPT' => string 'application/json, text/plain, */*' (length=33)
- 'HTTP_ORIGIN' => string 'http://localhost:4200' (length=21)
- '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)
- 'CONTENT_TYPE' => string 'application/json' (length=16)
- 'HTTP_REFERER' => string 'http://localhost:4200/categoria' (length=31)
- 'HTTP_ACCEPT_ENCODING' => string 'gzip, deflate, br' (length=17)
- 'HTTP_ACCEPT_LANGUAGE' => string 'es-419,es;q=0.9' (length=15)
- 'slim.url_scheme' => string 'http' (length=4)
- 'slim.input' => string '{"json":[{"nombre":"asda"}]}' (length=28)
- 'slim.errors' => resource(24, stream)
- 'slim.request.form_hash' =>
- array (size=0)
- ...
- 'slim.flash' =>
- object(SlimMiddlewareFlash)[19]
- ...
- public 'headers' =>
- object(SlimHttpHeaders)[44]
- protected 'data' =>
- array (size=10)
- 'Host' => string 'localhost' (length=9)
- 'Connection' => string 'keep-alive' (length=10)
- 'Content-Length' => string '28' (length=2)
- 'Accept' => string 'application/json, text/plain, */*' (length=33)
- 'Origin' => string 'http://localhost:4200' (length=21)
- '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)
- 'Content-Type' => string 'application/json' (length=16)
- 'Referer' => string 'http://localhost:4200/categoria' (length=31)
- 'Accept-Encoding' => string 'gzip, deflate, br' (length=17)
- 'Accept-Language' => string 'es-419,es;q=0.9' (length=15)
- public 'cookies' =>
- object(SlimHelperSet)[46]
- protected 'data' =>
- array (size=0)
- empty
Add Comment
Please, Sign In to add comment