Skip to content

Commit 36bb361

Browse files
fix(bootstrapper): bootstrapper should use httpx (#45)
* Use httpx * Update print statement
1 parent b56aaad commit 36bb361

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/bootstrapper/runtime/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN echo "Using PGSTAC Version ${PGSTAC_VERSION}"
55

66
WORKDIR /tmp
77

8-
RUN pip install requests psycopg[binary,pool] pypgstac==${PGSTAC_VERSION} -t /asset
8+
RUN pip install httpx psycopg[binary,pool] pypgstac==${PGSTAC_VERSION} -t /asset
99

1010
COPY runtime/handler.py /asset/handler.py
1111

lib/bootstrapper/runtime/handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import boto3
88
import psycopg
9-
import requests
9+
import httpx
1010
from psycopg import sql
1111
from psycopg.conninfo import make_conninfo
1212
from pypgstac.db import PgstacDB
@@ -58,10 +58,10 @@ def send(
5858
headers = {"content-type": "", "content-length": str(len(json_responseBody))}
5959

6060
try:
61-
response = requests.put(responseUrl, data=json_responseBody, headers=headers)
61+
response = httpx.put(responseUrl, data=json_responseBody, headers=headers)
6262
print("Status code: " + response.reason)
6363
except Exception as e:
64-
print("send(..) failed executing requests.put(..): " + str(e))
64+
print("send(..) failed executing httpx.put(..): " + str(e))
6565

6666

6767
def get_secret(secret_name):

0 commit comments

Comments
 (0)