woocommerce / woocommerce/wc-api-php

PUT request stopped working

Open
#292 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
PHP
Stars
546
Forks
158
Avg merge
3h 21m
Merged PRs (30d)
2

Description

PUT requests stopped working. GET requests work fine.
Receiving:
Fatal error: Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: Syntax error in...

Code:

require(APP . '/lib/vendor/autoload.php');
use Automattic\WooCommerce\Client;
/*
$woocommerce = new Client(
    'https://xxx.com', 
    'xxx', 
    'xxx',
    [
        'wp_api' => true,
        'version' => 'wc/v3',
    ]
);


$data = [
		'status' => 'Completed'
	];
			
print_r($woocommerce->get('orders/xxx');
print_r($woocommerce->put('orders/xxx', $data));

Contributor guide

No contributing guide indexed for this repository

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 PUT call through lib/vendor/autoload.php and Automattic\WooCommerce\Client, comparing it with the working GET request and capturing the full HttpClientException response. No source file or test is named; done means identifying the PUT failure cause and adding a regression test that verifies the request succeeds or reports the corrected error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.