For your application JS code, you can just pass the data as URL query parameters:
var searchCriteria = $("#input-user-search").val();
// suitable validation and URL encoding ...
ff.getArrayFromExtension("/SeachUsers?search=" + searchCriteria,
function(result) {
// success
});
(Note that you can use the usual getArrayFromUri
function too, but you would have to give the full extension URI of `/ff/ext/SearchUsers' in that case.)
Then in your extension, you need to first get the passed in parameter:
var searchCriteria = ff.getExtensionRequestData().httpParameters['search'];
Finally, set the result:
var r = ff.response();
r.responseCode = 200;
r.result = matchedUsers;
Note that you could also use the postObjToExtension
function and, well, post an object to your extension, but that might be overkill for this scenario.