I send text data to the server with the following code:
import {Injectable} from '@angular/core'; import {HTTP_PROVIDERS, Http, Response, Headers, RequestOptions} from "@angular/http"; import {Observable} from 'rxjs/Rx'; @Injectable() export class DemoService { constructor(private http:Http) { } createFood() { let headers = new Headers({'Content-Type': 'application/json'}); let options = new RequestOptions({headers: headers}); let date = { id: 1, name: "Test" }; let body = JSON.stringify(date); return this.http.post('http://server.com.ua/api', body, headers).map((res:Response) => res.json()); } } On the server, I check the $ _POST array (to the file and to the mail) and there "[]" (empty);