Hi Can you add -v and have a look at the Authorization header? see if its present / the same for both the GET and the POST query
-- Morten On Mon, Sep 7, 2015 at 5:24 PM, channara rin <rin.chann...@gmail.com> wrote: > hi morten, > if i coding with PHP use CURL command. i still get the following error. > and my json in attached file. > By the way, i use apache v8 and DHIS2 v2.20 > [image: Inline image 1] > > > On Fri, Sep 4, 2015 at 3:58 PM, channara rin <rin.chann...@gmail.com> > wrote: > >> If i tried use test with -u ... that is work fine. but if i add more >> function like -X POST -d -v.... it doesn't work.... >> >> On Fri, Sep 4, 2015 at 3:55 PM, Bob Jolliffe <bobjolli...@gmail.com> >> wrote: >> >>> Hi Channara >>> >>> I just had a look at your original mail and I see that the user admin >>> was recognized so it means the curl option was ok but some issue with the >>> password. My guess is that you have some strange characters in the >>> password which are being expanded/interpreted by the shell. >>> >>> Try quoting like: >>> -u "admin:xxxxx" >>> or >>> -u 'admin:xxxxx' >>> >>> >>> On 4 September 2015 at 09:46, channara rin <rin.chann...@gmail.com> >>> wrote: >>> >>>> Hi Morten, >>>> Hi tried test with user:password first. but still error. >>>> >>>> On Thu, Sep 3, 2015 at 11:43 PM, channara rin <rin.chann...@gmail.com> >>>> wrote: >>>> >>>>> yes, it work too. >>>>> >>>>> >>>>> On Thu, Sep 3, 2015 at 6:45 PM, Morten Olav Hansen <morte...@gmail.com >>>>> > wrote: >>>>> >>>>>> Try to test with something simpler >>>>>> >>>>>> curl -u user:pass http://server/api/dataElements >>>>>> >>>>>> And see if it works >>>>>> >>>>>> -- >>>>>> Morten >>>>>> >>>>>> On Thu, Sep 3, 2015 at 5:23 PM, Knut Staring <knu...@gmail.com> >>>>>> wrote: >>>>>> >>>>>>> Channara, are you using GOW? >>>>>>> >>>>>>> https://github.com/bmatzelle/gow >>>>>>> >>>>>>> On Thu, Sep 3, 2015 at 12:08 PM, Morten Olav Hansen < >>>>>>> morte...@gmail.com> wrote: >>>>>>> >>>>>>>> I have also seen weird issues on window versions of cURL where -u >>>>>>>> user:pass is required to be FIRST (mac/linux should be fine) >>>>>>>> >>>>>>>> -- >>>>>>>> Morten >>>>>>>> >>>>>>>> On Thu, Sep 3, 2015 at 5:07 PM, Bob Jolliffe <bobjolli...@gmail.com >>>>>>>> > wrote: >>>>>>>> >>>>>>>>> Hi Channara >>>>>>>>> >>>>>>>>> The man page for curl indicates that the format of the command is: >>>>>>>>> >>>>>>>>> curl <options> <url> >>>>>>>>> >>>>>>>>> Try moving your url to the end of the line, after the options. >>>>>>>>> Also you might want to add "http://localhost..." >>>>>>>>> >>>>>>>>> On 3 September 2015 at 11:01, channara rin <rin.chann...@gmail.com >>>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> Hi DHIS2 friends, >>>>>>>>>> i tried use curl command to import tracker, but i got error. >>>>>>>>>> can you help me what is problem? >>>>>>>>>> ***THIS IS COMMAND RUNNING: >>>>>>>>>> [image: Inline image 1] >>>>>>>>>> >>>>>>>>>> ***THIS IS CONSOLE in APACHE >>>>>>>>>> [image: Inline image 2] >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Mailing list: https://launchpad.net/~dhis2-devs >>>>>>>>>> Post to : dhis2-devs@lists.launchpad.net >>>>>>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs >>>>>>>>>> More help : https://help.launchpad.net/ListHelp >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Mailing list: https://launchpad.net/~dhis2-devs >>>>>>>>> Post to : dhis2-devs@lists.launchpad.net >>>>>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs >>>>>>>>> More help : https://help.launchpad.net/ListHelp >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Mailing list: https://launchpad.net/~dhis2-devs >>>>>>>> Post to : dhis2-devs@lists.launchpad.net >>>>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs >>>>>>>> More help : https://help.launchpad.net/ListHelp >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Knut Staring >>>>>>> Dept. of Informatics, University of Oslo >>>>>>> Norway: +4791880522 >>>>>>> Skype: knutstar >>>>>>> http://dhis2.org >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Mailing list: https://launchpad.net/~dhis2-devs >>>>>> Post to : dhis2-devs@lists.launchpad.net >>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs >>>>>> More help : https://help.launchpad.net/ListHelp >>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Mailing list: https://launchpad.net/~dhis2-devs >>>> Post to : dhis2-devs@lists.launchpad.net >>>> Unsubscribe : https://launchpad.net/~dhis2-devs >>>> More help : https://help.launchpad.net/ListHelp >>>> >>>> >>> >> >
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp