Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Back to Basics - Using Curl in the SAP Enterprise Landscape

SAP via YouTube

Overview

Explore the powerful command-line HTTP client curl in the SAP enterprise landscape through this comprehensive tutorial. Learn essential techniques for working with HTTP, OAuth 2.0, and SAP Service Manager APIs. Discover how to retrieve access tokens, make authenticated API calls, and manage service instances using curl commands. Gain insights into URL encoding, content types, and HTTP headers while working with SAP Business Technology Platform. Practice creating, examining, and deleting service instances using curl, and learn to interpret API responses using tools like ijq and the btp CLI. Perfect for beginners and experienced developers alike, this hands-on guide covers everything from basic curl syntax to advanced usage scenarios in the SAP ecosystem.

Syllabus

Welcome and introduction
Off to the SAP Business API Hub to look at the task in hand
Examining the Service Manager API
Looking at the SAP Help Portal docu on how to get an access token and authenticate the calls
Considering the two OAuth 2.0 flows in use
Realising I'm an idiot and had completely missed the content-type header in my quiz question
Examining the docu's curl sample to retrieve a token
Exploring curl's help features
Considering HTTP POST and curl's many facilities for that
A short digression into getting curl to follow redirects with --location, and an examination of --verbose output
Looking at a more comfortable way to express x-www-form-urlencoded name/value pairs with multiple --data parameters
Digging into why the authenticated request for an access token failed: lack of URL encoding of the values
Examining the --data-urlencode parameter option, as opposed to --data
Comparing --include show the response headers with --verbose
Celebrating the receipt of an access token
Trying out a deliberately over-simplified curl request without authentication
Adding, with the --header parameter, a specific Authorization header
Comparing that with the use of --user which generates an Authorization header with some Base64 encoded string for a Basic authentication header automatically
A successfully authenticated call to the /v1/service_offerings endpoint
Avoiding curl's progress indicators with --silent
Getting ready to create a service instance with a POST request and a file-based payload with the @ mechanism of curl's --data parameter
'Useless use of cat' award from shellcheck, hurray!
Examining why we received an error "unsupported media type"
An unexpected but always welcome WhatsApp call from my son Joseph
Fixing the call with another --header parameter to specify that the Content-Type is of the payload I'm sending is application/json curl sends application/x-www-form-urlencoded by default
Getting a lovely HTTP 201 CREATED response altho the Location header is missing and checking the result with ijq and also the btp CLI
Finally, using curl to delete the instance with the --request DELETE parameter

Taught by

SAP Developers

Reviews

Start your review of Back to Basics - Using Curl in the SAP Enterprise Landscape

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.