How do I solve ok: false response with Angular 5 and .NET Core?
up vote
-1
down vote
favorite
There is simple method returning Ok:
[HttpGet("request_name")]
public IActionResult request_name()
{
using (var db = new WordContext())
{
return Ok("This is ok response string");
}
}
And simple request in ngx:
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`);
}.subscribe(x => {
});
I can see code 200 "This is ok response string" in chrome, but there is error message in chrome console:
ERROR HttpErrorResponse {headers: HttpHeaders, status: 200,
statusText: "OK", url:
"http://localhost:4200/main/name/request_name", ok: false, …}
What does it mean and how do I solve it?
Updated
The error message:
error:
error: SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31) at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47) at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34) at invokeTask (http://localhost:5010/polyfills.js:3862:14) at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)
message: "Unexpected token T in JSON at position 0"
stack: "SyntaxError: Unexpected token T in JSON at position 0↵ at JSON.parse (<anonymous>)↵ at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31)↵ at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47)↵ at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34)↵ at invokeTask (http://localhost:5010/polyfills.js:3862:14)↵ at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)"
__proto__: Error
text: "This is ok response string"
__proto__: Object
headers: HttpHeaders
lazyInit: ƒ ()
lazyUpdate: null
normalizedNames: Map(0) {}
__proto__: Object
message: "Http failure during parsing for http://localhost:5005/main/word/request_name"
name: "HttpErrorResponse"
ok: false
status: 200
statusText: "OK"
url: "http://localhost:5005/main/word/request_name"
c# angular .net-core httprequest httpresponse
add a comment |
up vote
-1
down vote
favorite
There is simple method returning Ok:
[HttpGet("request_name")]
public IActionResult request_name()
{
using (var db = new WordContext())
{
return Ok("This is ok response string");
}
}
And simple request in ngx:
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`);
}.subscribe(x => {
});
I can see code 200 "This is ok response string" in chrome, but there is error message in chrome console:
ERROR HttpErrorResponse {headers: HttpHeaders, status: 200,
statusText: "OK", url:
"http://localhost:4200/main/name/request_name", ok: false, …}
What does it mean and how do I solve it?
Updated
The error message:
error:
error: SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31) at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47) at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34) at invokeTask (http://localhost:5010/polyfills.js:3862:14) at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)
message: "Unexpected token T in JSON at position 0"
stack: "SyntaxError: Unexpected token T in JSON at position 0↵ at JSON.parse (<anonymous>)↵ at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31)↵ at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47)↵ at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34)↵ at invokeTask (http://localhost:5010/polyfills.js:3862:14)↵ at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)"
__proto__: Error
text: "This is ok response string"
__proto__: Object
headers: HttpHeaders
lazyInit: ƒ ()
lazyUpdate: null
normalizedNames: Map(0) {}
__proto__: Object
message: "Http failure during parsing for http://localhost:5005/main/word/request_name"
name: "HttpErrorResponse"
ok: false
status: 200
statusText: "OK"
url: "http://localhost:5005/main/word/request_name"
c# angular .net-core httprequest httpresponse
what is the complete error log?
– Jota.Toledo
Nov 10 at 19:52
@Jota.Toledo defaultErrorLogger @ core.js:1673 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719 next @ core.js:4311 schedulerFn @ core.js:3551 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 and so on
– mr_blond
Nov 10 at 20:08
Not the stack trace. I mean, you gotERROR: HttpErrorResponse ...
, which are the details of an error object. Could you update your question with the complete object details?
– Jota.Toledo
Nov 10 at 20:12
Ah, I see. I've added details to question.
– mr_blond
Nov 10 at 20:29
The error instance is clear, theHttpClient
tries to parse an invalid JSON string. See angular.io/guide/http#requesting-non-json-data
– Jota.Toledo
Nov 10 at 20:33
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
There is simple method returning Ok:
[HttpGet("request_name")]
public IActionResult request_name()
{
using (var db = new WordContext())
{
return Ok("This is ok response string");
}
}
And simple request in ngx:
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`);
}.subscribe(x => {
});
I can see code 200 "This is ok response string" in chrome, but there is error message in chrome console:
ERROR HttpErrorResponse {headers: HttpHeaders, status: 200,
statusText: "OK", url:
"http://localhost:4200/main/name/request_name", ok: false, …}
What does it mean and how do I solve it?
Updated
The error message:
error:
error: SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31) at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47) at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34) at invokeTask (http://localhost:5010/polyfills.js:3862:14) at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)
message: "Unexpected token T in JSON at position 0"
stack: "SyntaxError: Unexpected token T in JSON at position 0↵ at JSON.parse (<anonymous>)↵ at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31)↵ at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47)↵ at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34)↵ at invokeTask (http://localhost:5010/polyfills.js:3862:14)↵ at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)"
__proto__: Error
text: "This is ok response string"
__proto__: Object
headers: HttpHeaders
lazyInit: ƒ ()
lazyUpdate: null
normalizedNames: Map(0) {}
__proto__: Object
message: "Http failure during parsing for http://localhost:5005/main/word/request_name"
name: "HttpErrorResponse"
ok: false
status: 200
statusText: "OK"
url: "http://localhost:5005/main/word/request_name"
c# angular .net-core httprequest httpresponse
There is simple method returning Ok:
[HttpGet("request_name")]
public IActionResult request_name()
{
using (var db = new WordContext())
{
return Ok("This is ok response string");
}
}
And simple request in ngx:
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`);
}.subscribe(x => {
});
I can see code 200 "This is ok response string" in chrome, but there is error message in chrome console:
ERROR HttpErrorResponse {headers: HttpHeaders, status: 200,
statusText: "OK", url:
"http://localhost:4200/main/name/request_name", ok: false, …}
What does it mean and how do I solve it?
Updated
The error message:
error:
error: SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31) at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47) at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34) at invokeTask (http://localhost:5010/polyfills.js:3862:14) at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)
message: "Unexpected token T in JSON at position 0"
stack: "SyntaxError: Unexpected token T in JSON at position 0↵ at JSON.parse (<anonymous>)↵ at XMLHttpRequest.onLoad (http://localhost:5010/vendor.js:7457:51)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2743:31)↵ at Object.onInvokeTask (http://localhost:5010/vendor.js:36915:33)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:5010/polyfills.js:2742:36)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:5010/polyfills.js:2510:47)↵ at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (http://localhost:5010/polyfills.js:2818:34)↵ at invokeTask (http://localhost:5010/polyfills.js:3862:14)↵ at XMLHttpRequest.globalZoneAwareCallback (http://localhost:5010/polyfills.js:3888:17)"
__proto__: Error
text: "This is ok response string"
__proto__: Object
headers: HttpHeaders
lazyInit: ƒ ()
lazyUpdate: null
normalizedNames: Map(0) {}
__proto__: Object
message: "Http failure during parsing for http://localhost:5005/main/word/request_name"
name: "HttpErrorResponse"
ok: false
status: 200
statusText: "OK"
url: "http://localhost:5005/main/word/request_name"
c# angular .net-core httprequest httpresponse
c# angular .net-core httprequest httpresponse
edited Nov 10 at 20:26
asked Nov 10 at 19:23
mr_blond
13711
13711
what is the complete error log?
– Jota.Toledo
Nov 10 at 19:52
@Jota.Toledo defaultErrorLogger @ core.js:1673 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719 next @ core.js:4311 schedulerFn @ core.js:3551 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 and so on
– mr_blond
Nov 10 at 20:08
Not the stack trace. I mean, you gotERROR: HttpErrorResponse ...
, which are the details of an error object. Could you update your question with the complete object details?
– Jota.Toledo
Nov 10 at 20:12
Ah, I see. I've added details to question.
– mr_blond
Nov 10 at 20:29
The error instance is clear, theHttpClient
tries to parse an invalid JSON string. See angular.io/guide/http#requesting-non-json-data
– Jota.Toledo
Nov 10 at 20:33
add a comment |
what is the complete error log?
– Jota.Toledo
Nov 10 at 19:52
@Jota.Toledo defaultErrorLogger @ core.js:1673 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719 next @ core.js:4311 schedulerFn @ core.js:3551 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 and so on
– mr_blond
Nov 10 at 20:08
Not the stack trace. I mean, you gotERROR: HttpErrorResponse ...
, which are the details of an error object. Could you update your question with the complete object details?
– Jota.Toledo
Nov 10 at 20:12
Ah, I see. I've added details to question.
– mr_blond
Nov 10 at 20:29
The error instance is clear, theHttpClient
tries to parse an invalid JSON string. See angular.io/guide/http#requesting-non-json-data
– Jota.Toledo
Nov 10 at 20:33
what is the complete error log?
– Jota.Toledo
Nov 10 at 19:52
what is the complete error log?
– Jota.Toledo
Nov 10 at 19:52
@Jota.Toledo defaultErrorLogger @ core.js:1673 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719 next @ core.js:4311 schedulerFn @ core.js:3551 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 and so on
– mr_blond
Nov 10 at 20:08
@Jota.Toledo defaultErrorLogger @ core.js:1673 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719 next @ core.js:4311 schedulerFn @ core.js:3551 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 and so on
– mr_blond
Nov 10 at 20:08
Not the stack trace. I mean, you got
ERROR: HttpErrorResponse ...
, which are the details of an error object. Could you update your question with the complete object details?– Jota.Toledo
Nov 10 at 20:12
Not the stack trace. I mean, you got
ERROR: HttpErrorResponse ...
, which are the details of an error object. Could you update your question with the complete object details?– Jota.Toledo
Nov 10 at 20:12
Ah, I see. I've added details to question.
– mr_blond
Nov 10 at 20:29
Ah, I see. I've added details to question.
– mr_blond
Nov 10 at 20:29
The error instance is clear, the
HttpClient
tries to parse an invalid JSON string. See angular.io/guide/http#requesting-non-json-data– Jota.Toledo
Nov 10 at 20:33
The error instance is clear, the
HttpClient
tries to parse an invalid JSON string. See angular.io/guide/http#requesting-non-json-data– Jota.Toledo
Nov 10 at 20:33
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
If your response type is not a JSON it will just pass the response to the error
Try something like this
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.subscribe(x => {
});
Whereas don't use subscribe
use pipe
operator and tap
to read the response - hope i think you are using HttpClient
in angular
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.pipe(tap(res => {
console.log(res);
}));
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
To cutoff the request i just toldmap
changed as per you said - Thanks
– Rahul Swamynathan
Nov 11 at 2:12
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
If your response type is not a JSON it will just pass the response to the error
Try something like this
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.subscribe(x => {
});
Whereas don't use subscribe
use pipe
operator and tap
to read the response - hope i think you are using HttpClient
in angular
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.pipe(tap(res => {
console.log(res);
}));
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
To cutoff the request i just toldmap
changed as per you said - Thanks
– Rahul Swamynathan
Nov 11 at 2:12
add a comment |
up vote
0
down vote
accepted
If your response type is not a JSON it will just pass the response to the error
Try something like this
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.subscribe(x => {
});
Whereas don't use subscribe
use pipe
operator and tap
to read the response - hope i think you are using HttpClient
in angular
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.pipe(tap(res => {
console.log(res);
}));
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
To cutoff the request i just toldmap
changed as per you said - Thanks
– Rahul Swamynathan
Nov 11 at 2:12
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
If your response type is not a JSON it will just pass the response to the error
Try something like this
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.subscribe(x => {
});
Whereas don't use subscribe
use pipe
operator and tap
to read the response - hope i think you are using HttpClient
in angular
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.pipe(tap(res => {
console.log(res);
}));
If your response type is not a JSON it will just pass the response to the error
Try something like this
request_name() {
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.subscribe(x => {
});
Whereas don't use subscribe
use pipe
operator and tap
to read the response - hope i think you are using HttpClient
in angular
return this.http
.get<string>(`${this.apiUrl}/request_name`, {responseType: 'text'});
}.pipe(tap(res => {
console.log(res);
}));
edited Nov 11 at 2:11
answered Nov 10 at 19:27
Rahul Swamynathan
8861314
8861314
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
To cutoff the request i just toldmap
changed as per you said - Thanks
– Rahul Swamynathan
Nov 11 at 2:12
add a comment |
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
To cutoff the request i just toldmap
changed as per you said - Thanks
– Rahul Swamynathan
Nov 11 at 2:12
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
you needn't .pipe(map(res=>{...}). map is for change the response, if you want to check the value use pipe(tap(res=>{...})
– Eliseo
Nov 10 at 20:15
To cutoff the request i just told
map
changed as per you said - Thanks– Rahul Swamynathan
Nov 11 at 2:12
To cutoff the request i just told
map
changed as per you said - Thanks– Rahul Swamynathan
Nov 11 at 2:12
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242601%2fhow-do-i-solve-ok-false-response-with-angular-5-and-net-core%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what is the complete error log?
– Jota.Toledo
Nov 10 at 19:52
@Jota.Toledo defaultErrorLogger @ core.js:1673 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:1719 next @ core.js:4311 schedulerFn @ core.js:3551 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 and so on
– mr_blond
Nov 10 at 20:08
Not the stack trace. I mean, you got
ERROR: HttpErrorResponse ...
, which are the details of an error object. Could you update your question with the complete object details?– Jota.Toledo
Nov 10 at 20:12
Ah, I see. I've added details to question.
– mr_blond
Nov 10 at 20:29
The error instance is clear, the
HttpClient
tries to parse an invalid JSON string. See angular.io/guide/http#requesting-non-json-data– Jota.Toledo
Nov 10 at 20:33