@mateuspaegle wrote:
Hi guys!
I need to add a value in the header of the request, called HASH and also need to change the content-type of the same. In my research I found the following:
let _header = new Header (); _header.append ( 'Content-Type', 'application / x-www-form-urlencoded; charset = utf-8'); _header.append ('HASH', '1234567890'); this.http.post (url, params, {headers: _headers});
The problem is that the request does not go as I need ... If I remove the HASH the content-type is changed correctly, but if you add more than one property break all ...
With only the 'Content-Type'
Accept:*/* Accept-Encoding:gzip, deflate Accept-Language:pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4 Connection:keep-alive Content-Length:173 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 <--- OKKKKK Host:192.168.0.28 Origin:http://192.168.0.28:8100 Referer:http://192.168.0.28:8100/?ionicplatform=ios User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
With the 'Content-Type' and 'HASH'
Accept:*/* Accept-Encoding:gzip, deflate, sdch Accept-Language:pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4 Access-Control-Request-Headers:content-type, hash <--- Wtf!? Access-Control-Request-Method:POST <--- Wtf!? Connection:keep-alive Host:192.168.0.28 Origin:http://192.168.0.28:8100 Referer:http://192.168.0.28:8100/?ionicplatform=ios User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
What is wrong? Someone?
Posts: 1
Participants: 1