I've already use http adapter and successfully send a request
but I can't do it with parameter
I want to send the parameter cmd=login
how to put it in parameter = []
?
var invocationData = {
adapter : 'RSSReader',
procedure : 'login',
parameters :[]
};
----------------------update-------------------------------
I try the official parameter format
var invocationData = {
adapter : 'HTTPAdapter',
procedure : 'login',
parameters :[{name : 'cmd', value : 'login'}]
};
but still send nothing?
<?xml version="1.0" encoding="UTF-8"?>
<displayName>HTTPAdapter</displayName>
<description>HTTPAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>my-ip-address</domain>
<port>80</port>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias></sslCertificateAlias>
<sslCertificatePassword></sslCertificatePassword>
-->
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
<procedure name="login"/>
and this is the adapter impl
function login() {
var input = {
method : 'post',
returnedContentType : 'json',
path : '/sp/api/'
};
return WL.Server.invokeHttp(input);}
Take a look at the examples provided in a newly creatd HTTP adapter in the -impl.js file.
You can do this like so:
Client JavaScript
Adapter XML
Adapter JavaScript