Ajay Rawat
Ajay Rawat

Reputation: 13

Initiate POST request type using Worklight Adapter API in iOS

I want to send some post data (e.g user name) as per requirement, and I am using worklight API is my iOS application, I want to know how can i Initiate work light request using POST data.

Currently I am sending request like following

WLProcedureInvocationData* invocation = [[WLProcedureInvocationData alloc] initWithAdapterName:<AdapterName> procedureName:<ProcedureName>];
invocation.parameters = @[userName];
[[WLClient sharedInstance] invokeProcedure:invocation withDelegate:productInfoServiceDelegate];
[invocation release];

I want to send above request using POST request type. is the Possible using worklight iOS API . Or is there any other way to pass data using header? that will also help me.

Upvotes: 1

Views: 161

Answers (1)

Anton
Anton

Reputation: 3166

WL API is used to communicate with WL Server. Worklight abstracts HTTP layer by providing you with easy invocation API. Any parameter you add to your procedure invocation data object will be sent as POST body underneath.

If you need to send header you can use WL.Client.addGlobalHeader() API.

Upvotes: 1

Related Questions