Bitcoin Forum
December 06, 2016, 10:26:42 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Can't connect to Mt. Gox API using C# .NET  (Read 1022 times)
jimbobway
Legendary
*
Offline Offline

Activity: 1380



View Profile
July 24, 2011, 03:12:58 AM
 #1

I'm doing a basic connection using .NET and I'm trying to get ticker info from Mt. Gox.

http://mtgox.com/api/0/data/ticker.php

However, it just hangs.  I've tried to connect to TradeHill's API ticker and it works fine for http, https, etc.

I tried to load mtgox.com but it hangs.  Something about Mt. Gox's server is causing .NET to hang.

The code below doesn't work.  It works for all other sites including Trade Hill's https, http, cnn.com, etc.

Code:
            WebRequest request = WebRequest.Create("https://mtgox.com/api/0/data/ticker.php");
            request.Credentials = CredentialCache.DefaultCredentials;
            WebResponse response = request.GetResponse();
            //Console.WriteLine(((HttpWebResponse)response).StatusDescription);
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);
            string responseFromServer = reader.ReadToEnd();
            //Console.WriteLine(responseFromServer);



Any ideas?

░░░░░░░░░██████░░░░░░░░░░░░▄▄▄
░░███░░██████░░░░░▄▄▄▄▄░░██
░░███░░█████████████
░░░░░░░░██████▀▀██████████
░░░░░░░░██████░░░░░██████████
░░░░░░▄▄▄▄▄▄░░░▄▄▄░░░░███████
░░░░░██████░░░███░░░░███████
░░░░░██████░░░███
░░░░░███████▄▄▄▄▄████████
░░░░░████████████████████
░░▄▄▄▄▄░░█████░░░░█████████
█████░░█████░░░░█████████
█████░░░░░░░░░░░░█████████
█████░░░░░░░░░░░░░█████████

START GETTING PAID FOR YOUR ATTENTION!
███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
JUSTICE IN THE WORLD OF ONLINE ADVERTISING!

BUY MASS COIN 】【 ICO PROSPECTUS
VISIT OUR WEBSITE
TWITTER 】【 FACEBOOK 】【 TELEGRAM

1481020002
Hero Member
*
Offline Offline

Posts: 1481020002

View Profile Personal Message (Offline)

Ignore
1481020002
Reply with quote  #2

1481020002
Report to moderator
1481020002
Hero Member
*
Offline Offline

Posts: 1481020002

View Profile Personal Message (Offline)

Ignore
1481020002
Reply with quote  #2

1481020002
Report to moderator
1481020002
Hero Member
*
Offline Offline

Posts: 1481020002

View Profile Personal Message (Offline)

Ignore
1481020002
Reply with quote  #2

1481020002
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
MagicalTux
VIP
Hero Member
*
Offline Offline

Activity: 617


Working on new MtGox features


View Profile WWW
July 24, 2011, 03:21:54 AM
 #2

Are you sure your request sets a user agent? Could you provide both your request and a traceroute to mtgox so I can forward that to Prolexic ?

jimbobway
Legendary
*
Offline Offline

Activity: 1380



View Profile
July 24, 2011, 06:01:29 PM
 #3

Ok, setting the user agent worked and I can now get ticker info.  Weird because other sites don't require the user agent.  Thx!!!

░░░░░░░░░██████░░░░░░░░░░░░▄▄▄
░░███░░██████░░░░░▄▄▄▄▄░░██
░░███░░█████████████
░░░░░░░░██████▀▀██████████
░░░░░░░░██████░░░░░██████████
░░░░░░▄▄▄▄▄▄░░░▄▄▄░░░░███████
░░░░░██████░░░███░░░░███████
░░░░░██████░░░███
░░░░░███████▄▄▄▄▄████████
░░░░░████████████████████
░░▄▄▄▄▄░░█████░░░░█████████
█████░░█████░░░░█████████
█████░░░░░░░░░░░░█████████
█████░░░░░░░░░░░░░█████████

START GETTING PAID FOR YOUR ATTENTION!
███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
JUSTICE IN THE WORLD OF ONLINE ADVERTISING!

BUY MASS COIN 】【 ICO PROSPECTUS
VISIT OUR WEBSITE
TWITTER 】【 FACEBOOK 】【 TELEGRAM

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!