Page 1 of 1

POST request

Posted: Wed Mar 13, 2013 5:05 pm
by Andrew Majskiy

Hello! I try to execute service with JS in following way:
http://easycaptures.com/fs/uploaded/5...

In console I have an error:
{"message":"Json parsing error. Occurs at line=1, column=1.","errorCode":"004"}

In POST Tab in Fire Bug I see following request payload:
Image

What is it and how I can fix it?

Could you help me?
Thank you in advance.


POST request

Posted: Wed Mar 13, 2013 5:58 pm
by maxkatz

Can you show us your service setup?


POST request

Posted: Wed Mar 13, 2013 8:02 pm
by Kateryna Grynko

Hi Andrew,

You shouldn't use JSON.stringify function.
Use the following code:

codeAddActivity.execute({
processData: false,
data: [{
"sourceType": "Device",
...
}]
});/code


POST request

Posted: Thu Mar 14, 2013 11:45 am
by Andrew Majskiy

Max, here is service settings:
http://easycaptures.com/fs/uploaded/5...


POST request

Posted: Thu Mar 14, 2013 11:52 am
by Andrew Majskiy

Katya, your solution also does not work. In this case I have following request payload
Image
Tiggzi still wraps my request in object.


POST request

Posted: Thu Mar 14, 2013 3:00 pm
by Maryna Brodina

Hello! As I replied here https://getsatisfaction.com/tiggzi/to... Tiggzi can send only object, not array. So the only one way is to use

code$.ajax({
......
data: JSON.stringify([{....}])
....
})/code


POST request

Posted: Thu Mar 14, 2013 3:11 pm
by Andrew Majskiy

OK, Thanks Marina!