[Angular] HttpErrorResponse headers: HttpHeaders, status: 400, statusText: "Bad Request", url: "http://localhost:4200/api/LinkGroup", ok: false, …}

1,887 views
Skip to first unread message

jamester go

unread,
Jun 19, 2018, 5:17:31 AM6/19/18
to ang...@googlegroups.com
Hi Good Day !

I  am currently trying to do a Post Request from my angular > Api> SQLServer
but experiencing this error i'm new to angular so may be you can help me with this
i've included some screen shot of my code below, feel free to check it out.


Image below , is the method that is being triggered when clicking the submit button.
and inside the method it goes directly to the Method for post in a service.


Below is the service that is being called


also the URL is not declared for i have included it in a JSON file which will be called 
every time the application is hosted

proxy.conf.json



Need an enlightenment with this error, can you help me with this.

Your help is highly appreciated

Thanks! :) 



Sander Elias

unread,
Jun 19, 2018, 7:26:59 AM6/19/18
to Angular and AngularJS discussion
hi Jamester,

A 400 is a server side error. So you have to examine what is happening in your server. 

Regards
Sander

jamester go

unread,
Jun 19, 2018, 7:57:50 AM6/19/18
to ang...@googlegroups.com
Thanks Okey checking now it seems that the only thing that i saw so far in the internet is that 
i need to put some setup for corrs, but i've already included it in the code,(please see below image)



did i miss something do i need to include something that is needed for this to work

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Jun 19, 2018, 8:22:38 AM6/19/18
to Angular and AngularJS discussion
A 400 is not CORS error. But I have no clue where it goes sour. 

Regards
Sander

jamester go

unread,
Jun 19, 2018, 8:59:58 AM6/19/18
to ang...@googlegroups.com
I've checked the flow of data it seems that i have some error in the object that i've sending to the web api that is why it's having an error

Thanks for the help i'll be checking this one

--
Reply all
Reply to author
Forward
0 new messages