JSON_LISTINGS_FEED with error ["SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" ] from the server #841
Replies: 5 comments
-
Hello can anyone figure it out. |
Beta Was this translation helpful? Give feedback.
-
do you see this sample ? |
Beta Was this translation helpful? Give feedback.
-
hi abuzuhri: |
Beta Was this translation helpful? Give feedback.
-
so this part will not work out? |
Beta Was this translation helpful? Give feedback.
-
ok i know what's wrong |
Beta Was this translation helpful? Give feedback.
-
Hello:
Could the admin check this out:
I use the JSON_LISTINGS_FEED example to submit feed.
{{
""header"": {{
""sellerId"": ""{sellerId}"",
""version"": ""2.0"",
""issueLocale"": ""en_US""
}},
""messages"": [
{{
""messageId"": 1,
""sku"": ""{sku}"",
""operationType"": ""PATCH"",
""productType"": ""PRODUCT"",
""patches"": [
{{
""op"": ""replace"",
""path"": ""/attributes/purchasable_offer"",
""value"": [
{{
""currency"": ""USD"",
""our_price"": [
{{
""schedule"": [
{{
""value_with_tax"": {price}
}}
]
}}
]
}}
]
}}
]
}}
]
}}";
and send it out
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(createFeedDocumentResponse.Url.ToString());
byte[] bytes = null;
bytes = System.Text.Encoding.UTF8.GetBytes(jsonString);
request.ContentType = contentType;
request.ContentLength = bytes.Length;
request.Method = "PUT";
using (Stream requestStream = request.GetRequestStream())
{
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
HttpWebResponse webresponse = (HttpWebResponse)await request.GetResponseAsync();
if (webresponse.StatusCode == HttpStatusCode.OK)
{
Stream responseStream = webresponse.GetResponseStream();
string responseStr = await new StreamReader(responseStream).ReadToEndAsync();
// return responseStr;
}
}
But the result is SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.
I am not sure which place i may be doing incrrectly.
Beta Was this translation helpful? Give feedback.
All reactions