Невозможно cURL API, но он отлично работает в браузере - PullRequest
0 голосов
/ 24 февраля 2020

Я пытался получить некоторые данные из этого API. Я могу получить доступ к API через браузер, но не могу получить к нему доступ с помощью curl.

Ссылка API: https://www.nseindia.com/api/quote-equity?symbol=EIHOTEL

Также пробовал не http прокси: http://monuabhaysv-eval-test.apigee.net/nsetest

Я пробовал Другое

Curl Output
curl -v "https://www.nseindia.com/api/quote-equity?symbol=EIHOTEL"
*   Trying 23.206.203.115...
* TCP_NODELAY set
* Connected to www.nseindia.com (23.206.203.115) port 443 (#0)
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 181 bytes...
* schannel: sent initial handshake data: sent 181 bytes
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 2/3)
* schannel: encrypted data got 4096
* schannel: encrypted data buffer: offset 4096 length 4096
* schannel: encrypted data length: 4022
* schannel: encrypted data buffer: offset 4022 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 2/3)
* schannel: encrypted data got 1024
* schannel: encrypted data buffer: offset 5046 length 5046
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 2/3)
* schannel: encrypted data got 1024
* schannel: encrypted data buffer: offset 6070 length 6070
* schannel: encrypted data length: 13
* schannel: encrypted data buffer: offset 13 length 6070
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 2/3)
* schannel: encrypted data got 334
* schannel: encrypted data buffer: offset 347 length 6070
* schannel: sending next handshake data: sending 126 bytes...
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 2/3)
* schannel: encrypted data got 242
* schannel: encrypted data buffer: offset 242 length 6070
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with www.nseindia.com port 443 (step 3/3)
* schannel: stored credential handle in session cache
> GET /api/quote-equity?symbol=EIHOTEL HTTP/1.1
> Host: www.nseindia.com
> User-Agent: curl/7.55.1
> Accept: */*
>
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: server closed the connection
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 0 length 4096
* schannel: schannel_recv cleanup
* schannel: server closed abruptly (missing close_notify)
* Closing connection 0
* schannel: shutting down SSL/TLS connection with www.nseindia.com port 443
* schannel: clear security context handle
curl: (56) Failure when receiving data from the peer
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...