K
K
Konstantin2021-03-22 12:57:39
PHP
Konstantin, 2021-03-22 12:57:39

How to decode rest response?

Good afternoon. Tell me how to decode the response that comes from the given url https://api.edadeal.ru/web/localities/barnaul/enti...

It turns out gzip encoding here, but when I try to decode it in php, an error is generated
60586a0c231a9146084359.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-03-22
@Rsa97

I get a response from this address with the type application/x-protobuf
This is ProtoBuf , to read it, for good, you need to have a .proto file with the message structure.
PS It is also possible without a .proto file, but you will get a structure without field names, only values:

// Первая запись в полученном сообщении:
[
  1 => [
    1 => "\x3B\x31\xAB\x10\x63\x11\x11\xE6\x84\x9F\52\x54\x00\x10\xB6\x08"
    2 => "Продукты"
    4 => "https://yastatic.net/s3/edadeal-public-static/segments/svg/flat/seg_1.svg"
    5 => 1
    6 => 10
    8 => "food"
  ]
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question