Hey Everybody.
Have been reading up on this forum since the past few days as I just started learning technical analysis.
I'm an entrepreneur and software professional, so even though I'm a newbie at tech analysis,I can be of help here.
This is directed to the coder (xtalk) that made this app.
NSE is checking for the "Accept" and "Referer" header to block requests from your app.
I tested this in this manner using a http debugger
The url that your app tries to access is
http://www.nseindia.com/content/indices/ind_niftylist.csv
Now one can access that from a browser but your app gets sent a 403 forbidden response.
I wrote a few lines of code that are able to access this url successfully, so if you do the same, your app will work again :clap:
I would request you to implement the same into your app and give us guys an updated version ( I'm really looking forward to it..)
Codes in VB.net.. I would assume that if you are coding in c# you would find the equivalent
Code:
Sub getNSEData()
Try
objRequest = HttpWebRequest.Create("http://www.nseindia.com/content/indices/ind_niftylist.csv")
With objRequest
.UserAgent = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070216 Firefox/1.5.0.10"
.KeepAlive = False
.Method = "GET"
.AllowAutoRedirect = True
'.Referer = "http://nseindia.com/marketinfo/companyinfo/companysearch.jsp?cons=HDFC§ion=7"
.CookieContainer = CC
.Timeout = 60 * 1000
.Headers.Add("Pragma", "no-cache")
.Headers.Add("Cache-Control", "no-cache")
.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
.ServicePoint.Expect100Continue = False
End With
objResponse = objRequest.GetResponse()
Dim sReader As New IO.StreamReader(objResponse.GetResponseStream)
Dim HTML As String = sReader.ReadToEnd()
Catch ex As Exception
msgbox(ex.ToString())
End Try
End Sub
Please contact me in case you need help.. lets get this fixed :thumb: