Software Defined Networking
1754287 Members
2843 Online
108813 Solutions
New Discussion

Passing data from SKI to the bundle

 
sepbot
Advisor

Passing data from SKI to the bundle

In a simple application that I am trying to build, I have a method annotated with @POST in a resource java file in the ui bundle. Using cURL and specifying "X-Auth-Token" in the header and using method POST, I am able to access this method and have its code executed.

 

However I am not certain how to use the SKI framework to access this method. I created a view that contains a HTML form that users can fill out and submit. The HTML form is built using "api.lib.htmlTags" and has the correct action URL. When I click submit on the form, an authetication required JSON encoded message comes up.

 

Is there a specific function in SKI that I can use to post data which will include the authentication token in the header? Am I able to programatically get access to the authentication token being used? Am I expected to use $.post() to pass this information?

2 REPLIES 2
sepbot
Advisor

Re: Passing data from SKI to the bundle

After going through the JS source code, it seems that the authentication token can be accessed via auth.token and it can be passed to the server by using $.ajax.headers. $.post does support passing header information.

Sukar
Occasional Advisor

Re: Passing data from SKI to the bundle

Hello,

 

We are gald you found the answer, please do let us know if you need any further assistance regarding this query.

Please feel free to reply incase you have more questions around the same topic or open a new thread if new  topic.

 

If you feel this isuses is resolved, please do let us know by marking response as an 'accepted solution’.

 

Thanks

Sukar

 

HP SDN Team