-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyahoo.py
38 lines (30 loc) · 833 Bytes
/
yahoo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import requests
import os
class YahooMapRequest:
base_url = "https://map.yahooapis.jp/geocode/V1"
headers = {
'Content-Type': 'application/json',
}
def get(self, uri):
return requests.get(
self.base_url + uri,
headers=self.headers
)
def post(self, uri, body):
return requests.post(
self.base_url + uri,
str(body).encode('utf-8'),
headers=self.headers
)
def put(self, uri, body):
return requests.put(
self.base_url + uri,
str(body).encode('utf-8'),
headers=self.headers
)
def patch(self, uri, body):
return requests.patch(
self.base_url + uri,
str(body).encode('utf-8'),
headers=self.headers
)