Inanovator
Inanovator

Reputation: 9

What is the Angular JS equivalent of this Curl command?

curl -d @datavalueset.xml "https://apps.dhis2.org/demo/api/dataValueSets" -H "Content-Type:application/xml" -u admin:district -v

Upvotes: 0

Views: 578

Answers (1)

rnrneverdies
rnrneverdies

Reputation: 15647

Somethink like this. Keep in mind that you must provide the xml as string.

$http({ 
    method: 'POST',
    url: 'https://admin:[email protected]/demo/api/dataValueSets',
    data: '<content/>', // put here your XML
    headers: { "Content-Type": 'application/xml' }
})

Upvotes: 1

Related Questions