user agent over 255 characters

chembo 16 Reputation points

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/ 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.
2,640 questions
{count} vote

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,696 Reputation points Microsoft Employee

    @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.