Skip to content

Commit f99ee85

Browse files
committed
added HTTP override
1 parent 14a0049 commit f99ee85

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

amadeus/client/request.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,21 @@ def __build_http_request(self):
9292
return HTTPRequest(self.url,
9393
data=urlencode(self.params).encode(),
9494
headers=self.headers)
95-
9695
# Adds the authentication header since the bearer token has been set
9796
self.headers['Authorization'] = self.bearer_token
9897

98+
list_httpoverride = ['/v2/shopping/flight-offers',
99+
'/v1/shopping/seatmaps',
100+
'/v1/shopping/availability/flight-availabilities',
101+
'/v2/shopping/flight-offers/prediction',
102+
'/v1/shopping/flight-offers/pricing',
103+
'/v1/shopping/flight-offers/upselling']
104+
99105
if self.verb == 'POST':
106+
if self.path in list_httpoverride:
107+
self.headers['X-HTTP-Method-Override'] = 'GET'
108+
return HTTPRequest(self.url, headers=self.headers, method='POST',
109+
data=self.params.encode())
100110
if type(self.params) is dict:
101111
return HTTPRequest(self.url, headers=self.headers, method='POST',
102112
data=json.dumps(self.params).encode())

0 commit comments

Comments
 (0)