Clicky

  • Welcome to P2P Lending / NFT Lending Forum.
 

ETH.LOAN

News:

This was the original Lend Academy peer-to-peer lending forum, since forensically restored by deBanked and now reintroduced to eth.loan.

To restore access to your user account, email [email protected]. We apologize for errors you may experience during the recovery.

Main Menu
NEW LOANS:   | sandile.eth 0.200 Ξ | aipom.eth 0.299 Ξ | granbull.eth 0.299 Ξ | ALL

VB.NET Prosper API

Started by Peter, August 12, 2014, 11:00:00 PM

Previous topic - Next topic

ndp

I am writing some software in VB.NET to trade through the API.  I have sample code from Prosper that I have adapted, but it throws an 'unauthorized' error when I request files from the Prosper servers.  THe username and password are correct (and are specifically for API requests).

Prosper doesn't have the resources to explain why their sample code doesn't work.  Does anyone here have ideas?  Here's the code:

sub PROSPER()
        Try
            Dim ListingsURL, listing As String
            ListingsURL = "https://api.prosper.com/api/Listings?" class="bbc_link" target="_blank">https://api.prosper.com/api/Listings?$top=3"
            Using client = New System.Net.WebClient()
                client.Credentials = New System.Net.NetworkCredential(txtSettingsUsername.Text, txtSettingsPassword.Text)
                client.UseDefaultCredentials = False
                client.Headers.Add(System.Net.HttpRequestHeader.Accept, "text/csv") 'specify file type to download
                Using reader = New IO.StreamReader(client.OpenRead(ListingsURL)) '===> THIS THROWS A 401/UNAUTHORIZED ERROR
                    reader.ReadLine() 'wipe out the header
                    While (InlineAssignHelper(listing, reader.ReadLine())) IsNot Nothing
                        Console.WriteLine(listing)
                    End While
                End Using
            End Using
        Catch ex As SystemException
            MsgBox(ex.Message)
        End Try
end sub

neals384

For sure this is too obvious...somewhere you have set the values for
                txtSettingsUsername.Text and txtSettingsPassword.Text
equal to your username & pw, right?

NEW LOANS:   | sandile.eth 0.200 Ξ | aipom.eth 0.299 Ξ | granbull.eth 0.299 Ξ | ALL