Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix complex objects in fetch params #510

Closed
wants to merge 1 commit into from
Closed

Conversation

pavelsc
Copy link

@pavelsc pavelsc commented Aug 25, 2022

Исправил сериализацию сложных объектов, а то нет возможности отправить кнопки те же. Например следующий запрос в текущей версии отправляется

{
      keyboard: {
        one_time: true,
        buttons: [
          [
            {
              action: {
                type: "text",
                label: "Red",
                payload: "{\"button\":\"4\"}"
              },
              color: "negative"
            },
            {
              action: {
                type: "text",
                label: "Green",
                payload: "{\"button\":\"4\"}"
              },
              color: "positive"
            }
          ]
        ]
      }
}

как 'keyboard=%5Bobject+Object%5D'

@nitreojs
Copy link
Contributor

всмысле "нет возможности отправить кнопки"? Keyboard | VK-IO

@negezor
Copy link
Owner

negezor commented Sep 5, 2022

Этот PR добавит только проблем, нежели решения. Сам ВКонтакте принимает только application/x-www-form urlencoded. Это приводит к эффекту, что все незапланированные объекты будут отправлены в виде JSON. А сам JSON объект требуется только для каруселей и клавиатуры. Собственно это ломает Attachment объекты так это игнорирует toString() поведение.

@negezor negezor closed this Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants