Location头可以用于201 Created响应中的多个资源位置吗? [英] Can the Location header be used for multiple resource locations in a 201 Created response?

查看:183
本文介绍了Location头可以用于201 Created响应中的多个资源位置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

接受批量PUT创建然后返回多个位置的正确动词和响应是什么? Location头只显示支持一个Uri。

What is the correct verb and response to accept a batch PUT create and then return multiple locations? The Location header only appears to support one single Uri.

我原先假设我可以使用PUT进行批量创建并返回带有Uris列表的字符串数组,但是查看似乎不受支持的规范,但它也不完全清楚。

I assumed originally I could use PUT for a batch create and return an string array with a list of Uris, but in looking at the specification, that doesn't appear to be supported, but it isn't entirely clear either.

是否允许多个位置标题作为替代?

Are multiple Location headers permissible as an alternative?

任何建议?

推荐答案

不,你只能有一个Location头字段(是的,从规范中可以清楚地看到)。

No, you can have only one Location header field (and yes, it is clear from the spec).

话虽如此,PUT用于创建/更新单个资源。看来你正在使用它不是为......而设计的......

That being said, PUT is for creating/updating a single resource. It seems that you're using it for something it is not designed for...

这篇关于Location头可以用于201 Created响应中的多个资源位置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆