Author Topic: VB.NET Prosper API  (Read 6722 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
VB.NET Prosper API
« on: August 13, 2014, 09:54:00 AM »
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:

            Dim ListingsURL, listing As String
            ListingsURL = "$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
                    End While
                End Using
            End Using
        Catch ex As SystemException
        End Try
end sub


  • Full Member
  • ***
  • Posts: 113
    • View Profile
Re: VB.NET Prosper API
« Reply #1 on: August 14, 2014, 10:37:37 AM »
For sure this is too obvious...somewhere you have set the values for
                txtSettingsUsername.Text and txtSettingsPassword.Text
equal to your username & pw, right?