Skip to content

Trying to send POST request in R but didn't work #4

@garyzhubc

Description

@garyzhubc

Trying to send POST request in R but didn't work. I tried:

require(httr)

token_endpoint = 'https://icdaccessmanagement.who.int/connect/token'
client_id = '-------'
client_secret = '----'
scope = 'icdapi_access'
grant_type = 'client_credentials'

r <- POST(token_endpoint, add_headers('client_id'= client_id, 
                                            'client_secret'= client_secret, 
                                            'scope'= scope, 
                                            'grant_type'= grant_type))

with package httr following a Python version of this https://github.com/ICD-API/Python-samples/blob/master/sample.py

but I don't know where to find access_token in r

enter image description here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions