NFVO-57
[vnfsdk/refrepo.git] / openo-portal / portal-resmgr / src / main / webapp / resmgr-nfv / js / SendMsg.js
1 /* Copyright 2016, Huawei Technologies Co., Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *    http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 var sendMsg = {
16     get: "get",
17     post: "post"
18 }
19
20 function request(url, requestType, data, success, error, async) {
21     var setting = {
22         url: url,
23         async: async ? async : false,
24         type: requestType,
25         dataType: "json",
26         contentType: 'application/json;charset=UTF-8',
27         data: data,
28         success: success,
29         error: error
30     }
31
32     $.ajax(setting);
33
34 }