Update
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package cn.stock.market.utils;
|
package cn.stock.market.utils;
|
||||||
|
|
||||||
|
import cn.stock.market.constant.NseIndiaSymbol;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -58,10 +59,10 @@ public class NseIndiaRequest {
|
|||||||
public static String fetchData() {
|
public static String fetchData() {
|
||||||
initCookie();
|
initCookie();
|
||||||
|
|
||||||
String url = NSE_INDIA_URL + "/api/quote-equity?symbol=IPHL";
|
String url = NSE_INDIA_URL + "/api/quote-equity?symbol=" + NseIndiaSymbol.IPHL.getSymbol();
|
||||||
Request request = createRequest(url).newBuilder()
|
Request request = createRequest(url).newBuilder()
|
||||||
.addHeader("referer", "https://www.nseindia.com/")
|
.addHeader("referer", NSE_INDIA_URL)
|
||||||
.addHeader("origin", "https://www.nseindia.com")
|
.addHeader("origin", NSE_INDIA_URL)
|
||||||
.build();
|
.build();
|
||||||
try (Response response = client.newCall(request).execute()) {
|
try (Response response = client.newCall(request).execute()) {
|
||||||
if (!response.isSuccessful()) {
|
if (!response.isSuccessful()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user