0

I am writing application in Angular 5.

When I try to send request:

this.httpClient.post("https://api.textlocal.in/send/", new Message(this.apiKey, "xxxxxxxxx", "TEST", "SOIS_App")

I get:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.textlocal.in/send/. (Reason: missing token ‘access-control-allow-headers’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).

How can I get CORB when I am sending request form my computer to https://api.textlocal.in ??

PiotrKowalski
  • 135
  • 2
  • 14

1 Answers1

0

How can I get CORB when I am sending request form my computer to https://api.textlocal.in

Enable CORS on your your server for address localhost (or wherever you are running the app from).

Detailed guide

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Quick guide

  1. Enable an OPTIONS endpoint
  2. Enable headers on your post:

Access-Control-Allow-Origin: http://foo.example Access-Control-Allow-Methods: POST Access-Control-Allow-Headers: Content-Type

basarat
  • 261,912
  • 58
  • 460
  • 511