WordPress / WordPress/Requests

[Question] How to get the data about the request that gets sent?

Open
#288 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.6k
Forks
500
Avg merge
2d 21h
Merged PRs (30d)
5

Description

$domain_URL = 'http://some.url.com/';
$event_relative_URL = '/relative/path/';
$session = new Requests_Session($domain_URL);
$response = $session->get($event_relative_URL);

$requestURL = '/api?something=here&and=there'
$payload = {[...]} // some data there

And now I need to do

$response = $session->post($requestURL, [], json_encode($payload))

but I'd like to debug how the outgoing request looks like. How to do that?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names Requests_Session and the get/post calls but no repository file or test. Start by tracing that session usage and the outgoing-request API; done means documenting how to inspect the fully assembled request, including its URL and payload.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.