Open Zerokami opened 8 years ago
+1 would really like to have cookie-support as well
Nevermind, the plugin was already capable of doing what I needed. @Logmytech is set the Cookie-header like so:
cordovaHTTP.setHeader("Cookie", "cookie1=cookie_value1 ; another_cookie=cookie_value2"), function() {
console.log('session cookie success!');
}, function() {
console.log('session cookie error :(');
});
@Jacse if we want to make post request with headers ,should we add your line of code before post request or we can add the headers inside post request?
@ehaab before the request if I remmenes correctly. Also no callbacks needed
@Jacse could you tell how to construct the post request if i want to send these values to api ? I don't know which ones should be as header and which ones as data !
POST http://xxxxxxxxxxxxxxx/api/itemURL/1234 HTTP/1.1
API_KEY: XXXXXXXXXXXXXXXXXXXXXXXX
UserID: XXXXXXXXXXXXXXXXXXXXXXXXX
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.2.2; Galaxy Nexus Build/JDQ39)
Host: XXXXXXXXXXXXXXXXXXXXX
Cookie: __cfduid=2342435465423eafrsdfdfaesdfasdqwr41234
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
I want to do some webscraping and was wondering if it was possible to set the "referrer" header and other headers to whatever I want. Also can I add custom cookies and bypass the default cookies?