WordPress / WordPress/Requests

URI Too Long

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

Nobody has claimed this yet.

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

Description

Hi,
I'm using your lib to connect a Wordpress and a personnal application. The wordpress could send some attachments encoded in B64. So i'm using a WS using post() but the parameters are passed like in a GET request and throw me the 414 URI Too Long error

Here is a piece of my code :

$options = array(
                'auth'        => new Requests_Auth_Basic(array($cfg['user'], $cfg['pass'])),
                'data_format' => 'query'
    );
 $storeAttachmentResourceParams = array(
            'encodedFile'   => $PJ['content'],
            'resId'         => $resId,
            'data'          => array(
                                        array('column' => 'title', 'value' => 'PJ', 'type' => 'string'),
                                        array('column' => 'attachment_type', 'value' => 'simple_attachment', 'type' => 'string'),
                                        array('column' => 'status', 'value' => 'A_TRA', 'type' => 'string'),
                                      ),
            'collId'        => 'letterbox_coll',
            'collIdMaster'  => 'letterbox_coll',
            'table'         => 'res_attachments',
            'fileFormat'    => $ext

$storeAttachmentResource = Requests::post($cfg['url'] . '/attachments', array(), $storeAttachmentResourceParams, $options)

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

Start by reproducing the request shown with Requests::post(), the /attachments endpoint, and data_format set to query. Inspect how the library encodes the supplied parameters and determine the expected request-body behavior; done means the encoded attachment no longer produces a 414 URI Too Long response.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.