Guest User

Untitled

a guest
Mar 15th, 2018
1,087
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. input {
  2. http {
  3. response_headers => {
  4. "Access-Control-Allow-Origin" => "*"
  5. "Access-Control-Allow-Headers" => "*"
  6. "Access-Control-Allow-Methods" => "*"
  7. "Access-Control-Allow-Credentials" => "*"
  8. }
  9. port => 5000
  10. user => "hi"
  11. password => "there"
  12. }
  13. }
  14.  
  15. output {
  16. elasticsearch {
  17. hosts => "elasticsearch:9200"
  18. }
  19. }
  20.  
  21. const headers = new HttpHeaders().append('Access-Control-Allow-Origin', '*');
  22. this.httpClient.
  23. post<any>('http://myhost/logstash', {message: 'test'}, { headers: headers, responseType: 'text' as 'json' })
  24. .subscribe(
  25. data => console.log(data),
  26. error => console.log(error));
  27.  
  28. headers = headers.append('Authorization', 'Basic ' + btoa('hi:there'));
Add Comment
Please, Sign In to add comment