Answer the question
In order to leave comments, you need to log in
How to do this in php?
Hello! How to execute this request in php?
POST /myservice HTTP/1.1
Host: rpc.example.com
Content-Type: application/json
Content-Length: ...
Accept: application/json
{
"jsonrpc": "2.0",
"method": "sum",
"params": { "b": 34, "c": 56, "a": 12 },
"id": 123
}
Answer the question
In order to leave comments, you need to log in
CURL? php.net/manual/en/book.curl.php
all these headers are easily set via curl_setopt
Usually use cURL
But you can also file_get_contents with the third argument filled in.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question