Angular-Ionic HttpClient Post request to Asp.net Api retruns 400 but swagger returns 200/401

I have a Ionic App and a asp.net Api. To authorize I send the Login Credentials in a Post request. Swagger returns this: or When sending my Post request like this: httpOptions = { headers: new HttpHeaders({ ‘content-Type’: ‘application/json’, ‘accept’: ‘*/*’ }) }; login(credentials: {username: string; pw: string}): Observable <any> { return this.http.post(‘https://localhost:7206/auth/login&#8217;, credentials, this.httpOptions)… Read More Angular-Ionic HttpClient Post request to Asp.net Api retruns 400 but swagger returns 200/401

Getting Specific Header value from Head call response in Flutter

I am performing Head call as below using http: Future<void> fetchModifiedDate(String fileUrl,BuildContext context) async{ if (await checkNetworkConnection(context)) { var responseValue = []; var response = http.head(Uri.parse(fileUrl)); response.then((value) { responseValue = value.headers.values.toString().split(","); modifiedDate = responseValue[1].trim(); print(value.headers.toString()); print(value.headers.values.toString()); }); } The values which I am getting from Header is as below : For print(value.hedaers.toString()), {x-served-by: psm100.akshar-dev.ml, connection:… Read More Getting Specific Header value from Head call response in Flutter