2016-04-25 4 views
0

Я пытаюсь установить переменную в config.yml из 8p Guzzle расслоения (https://github.com/8p/GuzzleBundle), как это:Используйте слэш в config.yml переменной

guzzle: 
    clients: 
     identity_api: 
      base_url: "%some.url%:5000/v2.0" 

и делает типичный ПОЛУЧАЕТЕ:

$client = $this->container->get('guzzle.client.identity_api'); 
$response = $client->get('/users') 

но я получаю сообщение об ошибке, указывающее, что запрашиваемый адрес:

http://somedomain.com:5000/users 

Я думаю, что-то с slash, я пытаюсь сбрасывать с обратной косой чертой, но ничего.

+1

'$ клиент = $ this-> container-> Get ('guzzle.client.identity_api');' - это не 'guzzle.clients' в файле YAML? –

ответ

0

Моя ошибка, после http://docs.guzzlephp.org/en/latest/quickstart.html#making-a-request

base_uri   URI    Result 
http://foo.com  /bar   http://foo.com/bar 
http://foo.com/foo /bar   http://foo.com/bar 
http://foo.com/foo bar    http://foo.com/bar 
http://foo.com/foo/ bar    http://foo.com/foo/bar 
http://foo.com  http://baz.com http://baz.com 
http://foo.com/?bar bar    http://foo.com/bar 

Я должен удалить slash запроса пользователей.

$client = $this->container->get('guzzle.client.identity_api'); 
$response = $client->get('users')