I am trying to make a POST
Request for the Shippo REST API
in Swift, but since it needs an API Authentication key I cannot figure out how to implement the key in the URLSession
in Swift 4. As the Apple documentation puts it I cannot use urlsession.shared
method.
The cURL
command is:
curl https://api.goshippo.com/addresses/ \
-H "Authorization: ShippoToken shippo_test_Token_Here" \
-d name="Shawn Ippotle" \ -d company="Shippo" \
-d street1="215 Clayton St." \
-d street2="" \
-d city="San Francisco" \
-d state="CA" \
-d zip=94117 \
-d country="US" \
-d phone="+1 555 341 9393" \
-d email="shippotle@goshippo.com"\
-d is_residential=True\
-d metadata="Customer ID 123456"