$.ajax({ type: "POST", url: "https://cp.pushwoosh.com/json/1.3/setTags", data: { 'request':{ 'application':'79F81-0EA17', 'hwid': '69c7c0db221ac0376aed37d711a6495b4283f2d7627b0682ca865d892e5164e9','tags': {'Userid':'reduser'} } }, dataType:"json" }).done(function( data ) { console.log(data); });

console : POST https://cp.pushwoosh.com/json/1.3/setTags 400 (Bad request data)

400 error occur

what can i do ?

asked 13 May '14, 11:07
%EB%A5%98%EA%B7%BC%ED%95%98's gravatar image

류근하
112

edited 06 Jan '16, 08:01

XXXX's gravatar image

XXXX
2.2k6

Hi!

Because you send data as form-data. You need send data such as JSON - dataType - is type for response format. For more information please read http://api.jquery.com/jquery.ajax/

Valid request for U case is

$.ajax({
  type: "POST",
  url: "https://cp.pushwoosh.com/json/1.3/setTags",
  data: '{"request":{ "application":"79F81-0EA17", "hwid": "69c7c0db221ac0376aed37d711a6495b4283f2d7627b0682ca865d892e5164e9","tags": {"Userid":"reduser"}}}',
  dataType: "json"
}).done(function(data){
  console.log(data);
});
permanent link
answered 13 May '14, 19:17
XXXX's gravatar image

XXXX
2.2k6

edited 30 Jun '15, 16:24

thank you thank you thank you

permanent link
answered 14 May '14, 00:23
%EB%A5%98%EA%B7%BC%ED%95%98's gravatar image

류근하
112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×64
×37
×5
×1

question asked: 13 May '14, 11:07

question was seen: 4,441 times

last updated: 06 Jan '16, 08:01