From c2f12869b821fbb5d68a8443d5e330382218b646 Mon Sep 17 00:00:00 2001 From: Mike Marchetti Date: Fri, 31 Aug 2018 09:41:47 -0400 Subject: [PATCH] Fix Content-Type for ns-create The ns-create POST Content-Type was incorrectly set by any previous HTTP call. Signed-off-by: Mike Marchetti --- osmclient/sol005/ns.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osmclient/sol005/ns.py b/osmclient/sol005/ns.py index c60baa0..90bf8db 100644 --- a/osmclient/sol005/ns.py +++ b/osmclient/sol005/ns.py @@ -159,6 +159,11 @@ class Ns(object): self._apiResource = '/ns_instances_content' self._apiBase = '{}{}{}'.format(self._apiName, self._apiVersion, self._apiResource) + headers = self._client._headers + headers['Content-Type'] = 'application/yaml' + http_header = ['{}: {}'.format(key,val) + for (key,val) in list(headers.items())] + self._http.set_http_header(http_header) http_code, resp = self._http.post_cmd(endpoint=self._apiBase, postfields_dict=ns) #print 'HTTP CODE: {}'.format(http_code) -- 2.17.1