Andrew Majskiy
Posts: 0
Joined: Fri Jan 04, 2013 1:31 pm

POST request

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

POST request

Can you show us your service setup?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

POST request

Hi Andrew,

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

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

Andrew Majskiy
Posts: 0
Joined: Fri Jan 04, 2013 1:31 pm

POST request

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

Andrew Majskiy
Posts: 0
Joined: Fri Jan 04, 2013 1:31 pm

POST request

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

POST request

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

Andrew Majskiy
Posts: 0
Joined: Fri Jan 04, 2013 1:31 pm

POST request

OK, Thanks Marina!

Return to “Issues”