user agent over 255 characters

chembo 16 Reputation points
2022-11-27T09:30:44.15+00:00

I am developing a program by leveraging the text-to-speech cognitive services on the framework of wechat that we call Miniprogram.

here is my problem: my http request to the cognitive-services can't define my own user-agent, the framework(Miniprogram) will define it automatically, this is how my user-agent looks like:

User-Agent: Mozilla/5.0 (Linux; Android 12; 2206122SC Build/SKQ1.220303.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4343 MMWEBSDK/20221011 Mobile Safari/537.36 MMWEBID/5638 MicroMessenger/8.0.30.2260(0x28001E3B) WeChat/arm64 Weixin NetType/WIFI Language/en ABI/arm64 MiniProgramEnv/android

And i got 400 because it's value over 255 characters.
The pain is I can't get around this user-agent problem.

Any suggestion?

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,572 questions
{count} vote

1 answer

Sort by: Most helpful
  1. romungi-MSFT 48,886 Reputation points Microsoft Employee Moderator
    2022-11-28T11:58:44.003+00:00

    @chembo The user agent header accepts a value which is 255 characters are documented in the mentioned link. I do not see a work around for the same if you are using the REST API. Is it possible to use any of the SDKs with this program?

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.