Facing 302 found an error in command line while Sending data values using the POST request API

Ref Link: Data - DHIS2 Documentation

I have gone through the above link and tried to post Data Value using XML file with the same example data as given on the Ref Link page.

I have executed API in the command line but it is giving “302 found” error.

API: curl -d @datavalueset.xmlDHIS 2 Demo - Sierra Leone” -H “Content-Type:application/xml” -u admin:district
Note: Execute above API in command line (windos)
datavalueset.xml contains,

I have done google, what “302 found” means, it says ‘The HyperText Transfer Protocol (HTTP) 302 Found redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location header.’

I want to add respective data set value using API.
Kindly do the needful.

Hi @kandarpjoshi

play.dhis2.org/demo site redirects to the latest version, and currently it’s redirecting to: https://play.dhis2.org/

Would you please try to change the api request URL to: https://play.dhis2.org/

Hope this solves it. Thanks!

Thanks, @Gassim ,
Now I got “Import process completed successfully” message on the command line.
Can you please guide me on how to check whether API data is inserted or not using Data Visualization tool?