Httpclient post not working in angular device but its working in browser

Hi,
finally i fixed the problem by installing CORS from below link
https://www.iis.net/downloads/microsoft/iis-cors-module

and add the below tag in web.config file within the <system.webserver> tab

       <cors enabled="true" failUnlistedOrigins="true">
	     <add origin="*" maxAge="600"> 
		 <!-- allowCredentials="true" -->
		 
		<allowHeaders allowAllRequestedHeaders="true">
			<add header="header1" />
			<add header="header2" />
		</allowHeaders>
		<allowMethods>
			 <add method="POST" />
			 <add method="OPTIONS" />
		</allowMethods>
		<exposeHeaders>
			<add header="header1" />
			<add header="header2" />
		</exposeHeaders>
	</add>
</cors>
1 Like

Please provide documentation link of Solution.

I have the same issue then I resolve it by downgrade Ionic-4 CLI version and I have created a git repository for this.

You can use it

1 Like

Thanks,
I will try for the next project :smiley:

ya i am facing the same issue

this works well!! after implementing it, then it works out well

Hi @kasimacsys,
Can you tell the exact place where we have to add the above code ? this would be really helpful.
Thanks.
From where can we find the web.config file in our project?

Where is the manifest.xml file you are talking about?
Is this the sentence to add:
android:usesCleartextTraffic=“true”
and in what point of the file?

I have 16 AndroidManifest.xml file in several locations in my project and no manifest.xml file.
I am facing the same issue, and made many attempts, none worked so far.
Thanks

Hi @nicolacardi

Please add this inside, app/manifests/AndroidManifest.xml file.

How did you resolve this issue?

This is exactly the problem I had to deal with recently. Android won’t send https requests to sites with misconfigured SSL Certs, so one possible fix is to check the cert chain of the site using https://www.sslshopper.com/ssl-checker.html
Then fix the cert bundle to include all certs in the chain, until sslshopper shows green arrows all the way.

See my longer answer to a similar question on this site.