如何使用Java从GET API调用中读取网络响应(PAYLOAD)

时间:2017-03-12 18:35:16

标签: java rest api httpurlconnection

我希望在使用

进行API GET调用后阅读网络响应
def create_table(dataset_name, table_name, project=None):
    """Creates a simple table in the given dataset.
    If no project is specified, then the currently active project is used.
    """
    bigquery_client = bigquery.Client(project=project)
    dataset = bigquery_client.dataset(dataset_name)

    if not dataset.exists():
        print('Dataset {} does not exist.'.format(dataset_name))
        return

    table = dataset.table(table_name)

    # Set the table schema
    table.schema = (
        bigquery.SchemaField('Name', 'STRING'),
        bigquery.SchemaField('Age', 'INTEGER'),
        bigquery.SchemaField('Weight', 'FLOAT'),
    )

    table.create()

    print('Created table {} in dataset {}.'.format(table_name, dataset_name))

请参阅附图,了解我想在Response中阅读的内容 在API GET调用之后。

enter image description here

0 个答案:

没有答案