Search code examples
pact

Provider's name with slash will make error


when I make a 'put request' to add pact-file like this

$c->request('PUT', "http://localhost:8000/pacts/provider/someString/someProviderName"  . '/consumer/someConsumerName' . '/version/0.0.1',
            [
                'body' => $str,
                'headers'=>['Content-Type' => 'application/json']
            ]);

the name of provider is "someString / someProviderName" this request will 404

if I change the "someString/someProviderName" to "someString-someProviderName"

it will work rightly(201 Status Code)

my english is poor T-T,sorry~~~


Solution

  • You can't have a slash in the provider name here, as it will request a different resource on the server (hence the 404).

    My suggestion is to remove the slash, or to URLEncode the provider name itself.