Issue
I'm bothered with an http failure response "Unknown error" and I didn't found where is the problem. With PDO when I send my object to Mysql server login with messageText "string" all is good and connected to Mysql, but when I add a query POST to table there is this error:
{"headers": {"normalizedNames": {},"lazyUpdate": null,"headers": {}},"status": 0,"statusText": "Unknown Error","url": "https://www.boulangerieqc.com/assets/crudmysql/insert_message.php","ok": false,"name": "HttpErrorResponse","message": "Http failure response for https://www.boulangerieqc.com/assets/crudmysql/insert_message.php: 0 Unknown Error","error": {"isTrusted": true}}
my .ts to catch my messageText is:
let connectionMysqlObjMessage={messageText:this.newMessage.value.messageText,db_host:this.extract.boulanger.db_host,db_username:this.extract.boulanger.db_username,db_name:this.extract.boulanger.db_name,db_password:this.extract.boulanger.db_password,}this.api.createMessageMysql(connectionMysqlObjMessage).subscribe((res)=>{console.log('avant api='+res)
my api:
createMessageMysql(MessageObj: Object) {return this.http.post(this.baseUrl + 'insert_message.php',MessageObj, {responseType: 'json'})}
If you have some ideas I will be happy to solve this.
Solution
Seems It's a CORS issue. Try to disable (or configure) it on server side. This should solved your issue
Answered By - Oscar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.