curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Semi-off-topic: Retrieving an SSRS report via curl

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Sun, 15 Jan 2017 15:23:58 -0500

On Sun, Jan 15, 2017 at 2:41 PM, Bill Mercer <bmercer_at_nccer.org> wrote:

> > Does anyone have experience using curl to download a report from
> > a Microsoft SSRS server? I’m trying to automate the retrieval of some
> > reports, and am having trouble building a URL that works with curl.
> >
> >
> > I think you should be able to copy the URL that was used to generated the
> > report in the browser and then use that with curl. What happens when you
> > do that?
>
> Mostly I'm getting 401 unauthorized errors. Identical URL and identical
> credentials, but different results depending on whether I'm using a browser
> or curl, so I'm thinking it's something about the SSRS authentication that
> is tripping me up.
>

Are you setting the User-Agent string in the curl call? I've had some
servers refuse to talk back if they didn't get even a basic browser-style
agent:

     curl -A "Mozilla/4.0" <other curl opts> https://.......

Ralph Mitchell

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-01-15