1 # Copyright 2019 AT&T Intellectual Property. All rights reserved.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 from ONAPLibrary.UUIDKeywords import UUIDKeywords
18 class RequestsHelper(object):
19 """ non keywords methods related to Requests library """
22 super(RequestsHelper, self).__init__()
23 self.uuid = UUIDKeywords()
24 self.application_id = "robot-ete"
26 def create_headers(self, sdc_user_id=None, accept="application/json", content_type="application/json", md5=None):
27 """Create the headers that are used by onap"""
28 uuid = self.uuid.generate_uuid4()
31 "Content-Type": content_type,
32 "X-TransactionId": self.application_id + "-" + uuid,
33 "X-FromAppId": self.application_id
36 headers["USER_ID"] = sdc_user_id
38 headers["Content-MD5"] = md5