Linux

> curl http://localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion
","params":[],"id":1}'



Windows Powershell

> curl http://localhost:8545 -contenttype "application/json" -method post -body '{"jsonrpc":"2.0","method":"web3_clientVersio
n","params":[],"id":1}'


-H 헤더내 ContentType → -contenttype 

-X → -method

--data → -body



응용


> curl http://localhost:8545 -contenttype "application/json" -method post -body '{"jsonrpc":"2.0","method":"web3_sha3","param
s":["0x68656c6c6f20776f726c64"],"id":1}'


StatusCode : 200
StatusDescription : OK
Content : {"jsonrpc":"2.0","id":1,"result":"0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad"}

RawContent : HTTP/1.1 200 OK
Vary: Origin
Content-Length: 103
Content-Type: application/json
Date: Thu, 06 Dec 2018 04:46:27 GMT

{"jsonrpc":"2.0","id":1,"result":"0x47173285a8d7341e5e972fc677286384f802f8ef4...
Forms : {}
Headers : {[Vary, Origin], [Content-Length, 103], [Content-Type, application/json], [Date, Thu, 06 Dec 2018 04:46:27 GMT]}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : System.__ComObject
RawContentLength : 103



> curl http://localhost:8545 -contenttype "application/json" -method post -body '{"jsonrpc":"2.0","method":"eth_getBalance","
params":["0x8d6259c5c7fab5f494399443faa531278f9dcb2c", "latest"],"id":1}'


StatusCode : 200
StatusDescription : OK
Content : {"jsonrpc":"2.0","id":1,"result":"0x144b7f2ef9eadd80000"}

RawContent : HTTP/1.1 200 OK
Vary: Origin
Content-Length: 58
Content-Type: application/json
Date: Thu, 06 Dec 2018 04:48:41 GMT

{"jsonrpc":"2.0","id":1,"result":"0x144b7f2ef9eadd80000"}

Forms : {}
Headers : {[Vary, Origin], [Content-Length, 58], [Content-Type, application/json], [Date, Thu, 06 Dec 2018 04:48:41 GMT]}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : System.__ComObject
RawContentLength : 58


'blockchain' 카테고리의 다른 글

geth 명령어들  (0) 2018.12.06
geth genesis.json (181205 기준)  (0) 2018.12.05
Windows PowerShell 에서 UNIX tail 명령어  (0) 2018.12.05
Posted by 아마루아00
,