How to Curl an Amazon Sagemaker Endpoint

If you want to simply send a POST request and check, you can use the postman and in the Authorization tab select the AWS Signature and add the Access and Secret key from the aws account.

But as mentioned it is recommended to use the Sage maker run time client for API call invocations.

enter image description here


This is how I do it (on MacOS):

$ (echo -n '{ INSERT JSON HERE }') | curl -H "Content-Type: application/json" -d @- $ENDPOINT_URL

Rather than using curl, it's recommended that you use the SageMaker Runtime client to send data and get back inferences from a SageMaker Endpoint:

http://docs.aws.amazon.com/sagemaker/latest/dg/API_runtime_InvokeEndpoint.html