-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete? #1
Comments
Hey It's still work in progress.. Basic functionality should work fine (get/post) .. other things like SSL pinning or download/upload will not work. |
How do you build headers though here? var payload3 = `<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetTransportInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
</u:GetTransportInfo>
</s:Body>
</s:Envelope>`;
var xmlHTTP2 = new XMLHttpRequest();
xmlHTTP2.open('POST', 'http://192.168.1.6:49152/ctl/AVTransport', true);
xmlHTTP2.setRequestHeader('SOAPAction', '"urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo"');
xmlHTTP2.setRequestHeader('Content-Type', 'text/xml; charset="utf-8"');
xmlHTTP2.onreadystatechange = function() {
if(xmlHTTP2.readyState === xmlHTTP2.DONE) {
console.log(xmlHTTP2.responseText);
} else {
console.log("not OK: " + JSON.stringify(xmlHTTP2));
}
};
xmlHTTP2.send(payload3); Payload is actually a command substitution, notice the backtick |
See the method signatures here: The third param is const payload3 = `<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetTransportInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
</u:GetTransportInfo>
</s:Body>
</s:Envelope>`;
const path = 'http://192.168.1.6:49152/ctl/AVTransport';
const headers = {
SOAPAction: '"urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo"',
'Content-Type': 'text/xml; charset="utf-8"'
};
NativeHttp.post(path, {}, headers, payload3, false); |
Hey
Is this project complete? Would like to use it instead of what cordova webview allows. Cordova doesn't allow connections unless it is defined in the config.xml
Also, the Android's okhttp library allows custom http requests. No need to specifically set a methods list. Some servers like Upnp asks it to connect by SUBSCRIBE and NOTIFY.
Would be nice if the lib allows it to set other HTTP methods, even for the ios versions
The text was updated successfully, but these errors were encountered: