Level 27
$response = Http::withToken('token here')->withBody('{ "query": "query { user { id defaultEmail } }", "variables": {} }', 'application/json')->post('https://gql.waveapps.com/graphql/public')
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Good day everyone,
I wanted to know if one can convert the below to a Http::get.... function instead of using cURL. I am using the waveapp package, but was wondering how this would be done
curl -X POST "https://gql.waveapps.com/graphql/public" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{ "query": "query { user { id defaultEmail } }", "variables": {} }'
$response = Http::withToken('token here')->get('https://gql.waveapps.com/graphql/public', [
'query' => ['user' => ['id', 'defaultEmail']];
])
$response = Http::withToken('token here')->withBody('{ "query": "query { user { id defaultEmail } }", "variables": {} }', 'application/json')->post('https://gql.waveapps.com/graphql/public')
Please or to participate in this conversation.