我想写一个批处理 OCAPI。
在其中一个子请求中,我想使用 product_search 和 variant_search OCAPI。
沙盒中的所有设置都是正确的,如果我单独使用它们,这两个 OCAPI 可以完美地工作。
仅当我批量使用它们时才会收到错误消息。
这是我的要求:
POST /s/-/dw/batch?client_id=xxx HTTP/1.1
Host: xxx-alliance-prtnr-eu09-dw.demandware.net
Content-Type: multipart/mixed; boundary=23dh3f9f4
Authorization: Bearer xxx
--23dh3f9f4
x-dw-content-id: req4
x-dw-http-method: POST
x-dw-resource-path-extension: /s/-/dw/data/v18_8/product_search
{
"query" : {
"text_query": {
"fields": ["id"],
"search_phrase": "73910432"
}
},
"select" : "(hits.(product_id))"
}
--23dh3f9f4
x-dw-http-method: POST
x-dw-content-id: req3
x-dw-resource-path: /s/-/dw/data/v18_8/products/
x-dw-resource-path-extension: 73910432/variant_search
{
"query": {
"text_query": {
"fields": [
"variation_attribute.size"
],
"search_phrase": "34"
}
},
"select": "(hits.(product_id,variation_values))"
}
--23dh3f9f4--
来自服务器的响应:
--23dh3f9f4
x-dw-content-id: req4
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 95
Cache-Control: no-cache
x-dw-status-code: 500
{"_v":"18.8","fault":{"type":"InternalServerErrorException","message":"Internal Server Error"}}
--23dh3f9f4
x-dw-content-id: req3
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 215
Cache-Control: no-cache
x-dw-status-code: 400
{"_v":"18.8","fault":{"arguments":{"parameter":"Body"},"type":"NullConstraintViolationException","message":"The null value constraint for parameter 'Body' is violated. Null is not allowed. Please provide a value."}}
--23dh3f9f4--
任何想法?
感谢您的小时帮助,