Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7998095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:08:02+00:00 2026-06-04T15:08:02+00:00

I am trying to download a report from Datacash via an HTTP post using

  • 0

I am trying to download a report from Datacash via an HTTP post using this page as a reference and I can’t figure out where I am going wrong.

My method is below:

private static void DownloadDatacashData(int howManyDays)
{
    string post, url, group, user, password, startDate, endDate, type, csvFile;

    url = "https://reporting.datacash.com/reporting2/csvlist?";

    group = "123456";
    user = "autoreport";
    password = "foobar";
    startDate = DateTime.Now.AddDays(howManyDays).ToString("yyyy-MM-dd");
    endDate = DateTime.Now.ToString("yyyy-MM-dd");
    type = "stl";

    post = String.Format(@"group={0}&user={1}&password={2}&start_date={3}&end_date={4}&type={5}", group, user, password, startDate, endDate, type);

    var request = (HttpWebRequest)WebRequest.Create(url);
    request.KeepAlive = false;
    request.ProtocolVersion = HttpVersion.Version11;
    request.Method = "POST";
    request.ContentLength = 0;

    var postBytes = Encoding.ASCII.GetBytes(post);

    request.ContentType = "application/x-www-form-urlencoded";
    request.ContentLength = postBytes.Length;
    var requestStream = request.GetRequestStream();

    requestStream.Write(postBytes, 0, postBytes.Length);
    requestStream.Close();

    var response = (HttpWebResponse)request.GetResponse();

    var sr = new StreamReader(response.GetResponseStream());
    csvFile = sr.ReadToEnd();
    sr.Close();

    var sw = new StreamWriter("C:\\foo\\bar.csv", false);
    sw.Write(csvFile);
    sw.Flush();
    sw.Close();
}

First of all, the post is performed. But I always get a file back with the text “Error: Report type not found”. If I change the URL, I get an error so this URL is definitely responding to HTTP post. I have tried this with and without the ? in the initial URL, and with and without the ? at the start of the post string.

I have already tried to get in touch with Datacash’s technical support and they couldn’t help me. I sent them the code I am using and all I got back was that there wasn’t anything wrong on their end.

The credentials are correct, the password is a combination of letters and numbers (no special characters).

I know that not many of you will have used datacash but looking at my code and the information here, is there anything obviously wrong with what I am doing? I am going around in circles.

Thankyou

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:08:03+00:00Added an answer on June 4, 2026 at 3:08 pm

    Your code seems way too complicated for something like this. Try simplifying:

    private static void DownloadDatacashData(int howManyDays)
    {
        var url = "https://reporting.datacash.com/reporting2/csvlist";
        using (var client = new WebClient())
        {
            var values = new NameValueCollection
            {
                { "group", "123456" },
                { "user", "autoreport" },
                { "password", "foobar" },
                { "start_date", DateTime.Now.AddDays(howManyDays).ToString("yyyy-MM-dd") },
                { "end_date", DateTime.Now.ToString("yyyy-MM-dd") },
                { "type", "stl" },
            };
            byte[] result = client.UploadValues(url, values);
            File.WriteAllBytes("C:\\foo\\bar.csv", result);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to download the image from the url http://a3.twimg.com/profile_images/414797877/05052008321_bigger.jpg I am using
Im trying to download share data from a stock exchange using python. The problem
I'm trying to download images (.jpg) from web folder using wget. I want to
I'm trying to download http://www.downway1.com/dota/eng/DotA%20Allstars%20v6.67.w3x this file. But it's not able to download. It's
I'm trying to scrape information from http://www.nfl.com/scores (in particular, find out when a game
Im trying to download a page contain a table like this <table id=content-table> <tbody>
I'm trying to download images from URLs and pass them to PIL. I would
I'm trying to download several images in response to a single http request. On
I am trying to download a CSV file using HttpResponse to make sure that
I'm trying to download an html file with curl in bash. Like this site:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.