0
votes

I am accessing Azure REST API using our HPOO's HTTP Client GET/POST/DELETE operations.

However, the http PUT requests containing Request BODY are throwing below error -- It works just fine with Postman app.

"InvalidResourceGroup","message":"The resource group definition is invalid."

We tried with API for creating a resource group

URL : https://management.azure.com/subscriptions/62a15758-4127-4b04-ac11-eda0baa41ee5/resourcegroups/RG334

here RG334 is the resource group I'm trying to Create.

2 Headers :

Content-Type : application/json
Authorization : Bearer token value

Query Parameter and value : api-version, 2015-01-01

Body :

{
  "location": "West US",
  "tags": {
    "tagname1": "value"
  }
}
1
try adding the 'Content-Length' headeryonisha
@yonisha Added. .Not working . Got this error "{resultText=GENERAL_ERROR;exception=org.apache.http.client.ClientProtocolException: Content-Length header already present ". Also , API document dint mention this header.user1744369

1 Answers

0
votes

when the request body is empty or invalid, Azure REST API throws this error, Please verify the payload which you are sending.