-
-
Save seit/7cef28813cab5d881fdb37f448a7bfb2 to your computer and use it in GitHub Desktop.
ApiClient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public <T> T post(Object request, Class<T> responseType, Object... uriVariables) { | |
HttpHeaders headers = new HttpHeaders(); | |
headers.set("X-Shopify-Access-Token", "<キー情報>"); | |
headers.set("Content-Type", "application/json"); | |
try{ | |
T response = restTemplate.postForObject("https://<shopifyホスト名>/admin/api/2020-10/graphql.json", | |
new HttpEntity<>(request, headers), | |
responseType, | |
uriVariables); | |
return response; | |
} catch (HttpClientErrorException e) { | |
throw e; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment