I'm actually using IBM Bluemix http JavaScript adapter to post data to a cloudant database. In adapters I'm basically giving path of my 'API Connect' sevice post api through which I want to post and update my JSON data into cloudant data from my application via adapter to cloudant database. But I'm not able to figure out on how I will be able to send the data which I'm able to get in application to http JavaScript post adapter. I have tried several ways for that but none of them worked. Below i am providing you an image through which you can understand what i have done to send my data to adapter at runtime. The image will be in 3 parts:-
Asked
Active
Viewed 184 times
1
-
Why dont't post some of the code you have tried already? – Vivin K Mar 24 '17 at 06:03
-
ok i am editing this question and sending you the image. – Alok Mar 24 '17 at 07:08
-
Vivin please review my editing code so that you could get a detailed description. – Alok Mar 24 '17 at 07:18
-
The issue is still not very clear. Are your calls not reaching the server? Or is it reaching the server and you are not able to invoke the backend? – Vivin K Mar 24 '17 at 08:49
-
i think my calls are not reaching the server. – Alok Mar 24 '17 at 09:56
-
Try using formparams. Also, debug the network flow with Wireshark at your client side. You could also print the output in the failure callback cases, in case the server is giving an error message – Vivin K Mar 24 '17 at 09:57
-
Then what will i give instead of value1 and value2. can you please tell me that ? – Alok Mar 24 '17 at 10:33
-
You will provide the values you wish to send to server - pmiwdc and abc from your example code – Vivin K Mar 24 '17 at 13:22
1 Answers
0
To send data from client to MFP adapter in a POST request, you should use form parameters.
var resourceRequest = new WLResourceRequest("/adapters/JavaAdapter/users",WLResourceRequest.POST);
var formParams = {"params":"['value1', 'value2']"};
resourceRequest.sendFormParameters(formParams);
For more details refer to the documentation :
1) Resource request from JavaScript (Cordova, Web) applications 2) WLResourceRequest

Vivin K
- 2,681
- 1
- 11
- 14