我有我的php代碼。如何在Go中創建這樣的內容?來自url的JSON解碼在
<?php
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$context = stream_context_create(array(
'http' => array(
'ignore_errors'=>true,
'method'=>'GET'
)
));
$response = json_decode(file_get_contents($url, false, $context));
print_r($response);
?>
看一看如何使一個GET請求http://golang.org/pkg/net/http/和http://golang.org/pkg/encoding/json /如何解碼接收的json。 – Volker