new HttpClient(config)
HttpClient.
Contains the "backend-connection" of the search bar. It submits the search query, parses the results and informs the callback as soon as these results are available.
Parameters:
Name | Type | Description |
---|---|---|
config |
module:searchMenuServiceClient.HttpSearchConfig |
- Source:
Example
new searchMenuServiceClient.HttpSearchConfig()....build();
Members
config :module:searchMenuServiceClient.HttpSearchConfig
Configuration for the search HTTP requests.
Type:
- Source:
Methods
search(searchParameters, onSearchResultsAvailable)
This function will be called to trigger search (calling the search backend).
Parameters:
Name | Type | Description |
---|---|---|
searchParameters |
Object | object that contains all parameters as properties. It will be converted to JSON. |
onSearchResultsAvailable |
module:searchMenuServiceClient.HttpClient.SearchServiceResultAvailable | will be called when search results are available. |
- Source:
Type Definitions
ParsedHttpResponseAvailable(resultData, httpStatus)
This function will be called when a already parsed response of the HTTP request is available.
Parameters:
Name | Type | Description |
---|---|---|
resultData |
Object | already parsed data object containing the results of the HTTP request |
httpStatus |
number | HTTP response status |
- Source:
SearchServiceResultAvailable(searchResultData)
This function will be called, when search results are available.
Parameters:
Name | Type | Description |
---|---|---|
searchResultData |
Object | already parsed data object containing the result of the search |
- Source:
TextHttpResponseAvailable(resultText, httpStatus)
This function will be called when a response of the HTTP request is available as text.
Parameters:
Name | Type | Description |
---|---|---|
resultText |
Object | response body as text |
httpStatus |
number | HTTP response status |
- Source: