0

Alguien sabe acerca de este error, Me pasa cuando conecto mi proyecto de ionic 4 en el servidor 000wehost.com, de manera local me sirve con Xampp. pero al subirlo al host me da el error.

introducir la descripción de la imagen aquí

import { Injectable } from '@angular/core';

import { Http, Headers, RequestOptions } from '@angular/http'; import 'rxjs/add/operator/map';

@Injectable() export class PostProvider { server: string = "https://proyectoapptuestilo.000webhostapp.com/server_api/proses-api.php/"; // default //server: string = "http://localhost/Conexion/server_api/proses-api.php/"; // default // if you test in real device "http://localhost" change use the your IP

constructor(public http : Http) {

}

postData(body, file){
    let type = "application/json; charset=UTF-8";
    let headers = new Headers({ 'Content-Type': type });
    let options = new RequestOptions({ headers: headers });

    return this.http.post(this.server + file, JSON.stringify(body), options)
    .map(res => res.json());

}

}

3
  • 1
    Podrias aportar mas datos sobre tu problema empezando que has intentado?
    – Capt.Teach
    el 24 sep. 2019 a las 16:57
  • intento hacer un registro de usuarios de mi App a la base de datos, como mencionaba de manera local me sirve pero al subirlo a host de la web no me sirve. el 24 sep. 2019 a las 17:08
  • Tengo el mismo problema, pudiste solucionarlo ? el 22 nov. 2019 a las 1:13

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.