← Back to team overview

dhis2-devs team mailing list archive

Re: Error 415 UNSUPPORTED_MEDIA_TYPE

 

Hi, that is correct. Meta-data CSV can only be imported through UI. It
would be feasible to add CSV to support to /metaData, we can do so later.

regards,

Lars


On Mon, Sep 14, 2015 at 8:29 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
wrote:

> Hi
>
> I will let Lars give you the definitive answer.. but I think its currently
> only possible to import CSV metadata through the UI, could you please try
> that out and see if it works for you?
>
> --
> Morten
>
> On Mon, Sep 14, 2015 at 1:19 PM, moses mwale <isoftcom.ic@xxxxxxxxx>
> wrote:
>
>> Am trying to create a new dataElement using CSV format. this is what am
>> getting.
>>
>> curl --data-binary @dataElements.csv "localhost:8082/api/dataElements" -H
>> "Content-Type:application/csv" -u admin:district -v
>>
>> *   Trying ::1...
>> * Connected to localhost (::1) port 8082 (#0)
>> * Server auth using Basic with user 'admin'
>> > POST /api/dataElements HTTP/1.1
>> > Authorization: Basic YWRtaW46ZGlzdHJpY3Q=
>> > User-Agent: curl/7.40.0
>> > Host: localhost:8082
>> > Accept: */*
>> > Content-Type:application/csv
>> > Content-Length: 333
>> >
>> * upload completely sent off: 333 out of 333 bytes
>> < HTTP/1.1 415 Unsupported Media Type
>> < X-XSS-Protection: 1; mode=block
>> < X-Frame-Options: DENY
>> < X-Content-Type-Options: nosniff
>> < Set-Cookie: JSESSIONID=1aaykhq834qennrisui46cx1z;Path=/
>> < Content-Type: text/html; charset=iso-8859-1
>> < Cache-Control: must-revalidate,no-cache,no-store
>> < Content-Length: 1407
>> < Server: Jetty(6.1.x)
>> <
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
>> <title>Error 415 UNSUPPORTED_MEDIA_TYPE</title>
>> </head>
>> <body><h2>HTTP ERROR 415</h2>
>> <p>Problem accessing /api/dataElements. Reason:
>> <pre>    UNSUPPORTED_MEDIA_TYPE</pre></p><hr /><i><small>Powered by
>> Jetty://</small></i><br/>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org <https://www.dhis2.org>

References