Closed toman-tom closed 1 year ago
@toman-tom fine for me. will include that in the next version.
Should work like this now :-)
const tlsClientLibrary = ffi.Library('./../dist/tls-client-darwin-amd64-1.2.0.dylib', {
'request': ['string', ['string']],
'getCookiesFromSession': ['string', ['string']],
'addCookiesToSession': ['string', ['string']],
'freeMemory': ["void", ['string']],
'destroyAll': ['string', []],
'destroySession': ['string', ['string']]
});
const payload = {
sessionId: 'my-session-id',
url: "https://example.com/",
cookies: [{
"name": "myCookieName",
"value": "myCookieValue",
}]
}
const resp = tlsClientLibrary.addCookiesToSession(JSON.stringify(payload))
Looks great! Thank you @bogdanfinn
Hi!
I'd love to see functionality whereby I can simply call a method to add cookies to the internal cookie jar. Yes I know I can send additional cookies in the
requestCookies
array, but better functionality (IMO) would be to have a function that I can call to add the additional cookies, without having to send them as part of the request.