As of this time, however, I'm afraid there isn't a built-in task can perfectly solve your question.
There is an Invoke REST API task that can invoke HTTP APIs and parse the response. But this task can be used in only an agentlees job, in other words, you cannot use this task unless you set your firewall to allow access from Azure DevOps.
Update: Using PowerShell task
Prerequisites: You need to use self-hosted agent so that you can access your application within your firewall.
The following is demonstrated using YAML pipeline. The steps for classic UI pipeline is roughly the same.
If you just want to get the response body:
Just use a Powershell task and send your web request:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
...
Invoke-RestMethod ...
If you want to save the response body as a variable:
Step 1. Set a variable:
variables:
result: null
Step 2. Use the PowerShell task to send a HTTP request and update the variable:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
...
$response = Invoke-RestMethod ...
Write-Host "##vso[task.setvariable variable=result;]$response"
Step 3. Then the value of $($env:RESULT)
is the response body of your web request, and you can use it in subsequent tasks.