我正在设计一个REST API(第一次),我对如何在POST请求中处理多语言有很多疑问。REST API,多语言设计
示例是广告提交。
- 我的选项1:
参数(...,...,title_en,title_pt,description_en,description_pt)
POST请求(名称,值)
some_field1, "some text1"
some_field2, "some text2"
title_en, "Some Title"
title_pt, "Algum Titulo"
description_en, "Some Description"
description_pt, "Alguma Descrição"
- 我的选项2:
参数(...,...,标题,描述)
POST请求(名称,值)
some_field1, "some text1"
some_field2, "some text2"
titles, [{"en":"Some Title","pt":"Algum Titulo"}]
descriptions, [{"en":"Some Description","pt":"Alguma Descrição"}]
我的问题:什么是做一个REST的正确方法API?
最好的问候, 安德烈
什么是资源的媒体类型为发布到API? –