Re: [Dev] Correct formats of x-www-form-urlencoded

2018-01-09 Thread Keerthika Mahendralingam
Hi Vijitha,

What if the backend expects the x-www-form-urlencoded type payload? In that
case, we can't use multipart/form-data.

Thanks,
Keerthika.

On Thu, Jan 4, 2018 at 1:18 PM, Vijitha Ekanayake  wrote:

> Hi Senduran,
>
> AFAIK, There is no standard documentation on how to convert JSON to
> x-www-form-urlencoded format as key-value pairs. As mentioned by Thusitha,
> When the JSON is getting complicated converting it to the
> x-www-form-urlencoded will also become complicated and may lead to
> inconsistencies over different payloads. Therefore I too think, we should
> use multipart/form-data in such situations.
>
>
> Thanks.
>
> On Thu, Jan 4, 2018 at 11:02 AM, Thusitha Thilina Dayaratne <
> thusithathil...@gmail.com> wrote:
>
>> Hi Senduran,
>>
>> IMHO x-www-form-urlencodedis for simple key value pairs. When the payload
>> is complicated, we should use multipart/form-data instead of
>> x-www-form-urlencoded content type. It can handle any complex complex
>> scenarios that you mentioned.
>>
>> Thanks
>> Thusitha
>>
>> On Wed, Jan 3, 2018 at 4:50 PM, Senduran Balasubramaniyam <
>> sendu...@wso2.com> wrote:
>>
>>> Hi all,
>>>
>>> When an XML or a JSON is converted to  x-www-form-urlencoded format the
>>> key value pair is created.
>>> i.e
>>>
>>> 
>>>   value1
>>>   value2
>>> 
>>>
>>> will be converted to key1=value=value2
>>>
>>> similarly
>>>
>>> {"key1" : "value1", "key2" : "value2"} also get converted to
>>> key1=value=value2
>>>
>>> But what if the XML or JSON is not only having simple key value i.e
>>> having an array or a child element
>>>
>>> for example,
>>> 
>>>   value1
>>>   
>>> subvalue1
>>> subvalue2
>>>   
>>> 
>>>
>>> similarly for JSON like
>>> {"key1" : "value1", "key2" : {"subkey1" : "subvalue1"}} or
>>>
>>> JSON with array
>>> {"key1" : "value1", "key2" : ["arrayvalue1", "arrayvalue2"]}
>>>
>>>
>>> Kindly let me know the available correct formats for
>>> application/x-www-form-urlencoded content type.
>>> Further it will be really helpful if you could point to a specification
>>> or a standard document
>>>
>>> Thanks
>>> Senduran
>>>
>>>
>>> --
>>> *Senduran *
>>> Senior Software Engineer,
>>> WSO2, Inc.;  http://wso2.com/ 
>>> Mobile: +94 77 952 6548 <077%20952%206548>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Vijitha Ekanayake
> Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/
> Mobile : +94 777 24 73 39 | +94 718 74 44 08
> lean.enterprise.middleware
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Keerthika Mahendralingam
Software Engineer
Mobile :+94 (0) 776 121144
keerth...@wso2.com
WSO2, Inc.
lean . enterprise . middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Correct formats of x-www-form-urlencoded

2018-01-03 Thread Vijitha Ekanayake
Hi Senduran,

AFAIK, There is no standard documentation on how to convert JSON to
x-www-form-urlencoded format as key-value pairs. As mentioned by Thusitha,
When the JSON is getting complicated converting it to the
x-www-form-urlencoded will also become complicated and may lead to
inconsistencies over different payloads. Therefore I too think, we should
use multipart/form-data in such situations.


Thanks.

On Thu, Jan 4, 2018 at 11:02 AM, Thusitha Thilina Dayaratne <
thusithathil...@gmail.com> wrote:

> Hi Senduran,
>
> IMHO x-www-form-urlencodedis for simple key value pairs. When the payload
> is complicated, we should use multipart/form-data instead of
> x-www-form-urlencoded content type. It can handle any complex complex
> scenarios that you mentioned.
>
> Thanks
> Thusitha
>
> On Wed, Jan 3, 2018 at 4:50 PM, Senduran Balasubramaniyam <
> sendu...@wso2.com> wrote:
>
>> Hi all,
>>
>> When an XML or a JSON is converted to  x-www-form-urlencoded format the
>> key value pair is created.
>> i.e
>>
>> 
>>   value1
>>   value2
>> 
>>
>> will be converted to key1=value=value2
>>
>> similarly
>>
>> {"key1" : "value1", "key2" : "value2"} also get converted to
>> key1=value=value2
>>
>> But what if the XML or JSON is not only having simple key value i.e
>> having an array or a child element
>>
>> for example,
>> 
>>   value1
>>   
>> subvalue1
>> subvalue2
>>   
>> 
>>
>> similarly for JSON like
>> {"key1" : "value1", "key2" : {"subkey1" : "subvalue1"}} or
>>
>> JSON with array
>> {"key1" : "value1", "key2" : ["arrayvalue1", "arrayvalue2"]}
>>
>>
>> Kindly let me know the available correct formats for
>> application/x-www-form-urlencoded content type.
>> Further it will be really helpful if you could point to a specification
>> or a standard document
>>
>> Thanks
>> Senduran
>>
>>
>> --
>> *Senduran *
>> Senior Software Engineer,
>> WSO2, Inc.;  http://wso2.com/ 
>> Mobile: +94 77 952 6548 <077%20952%206548>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Vijitha Ekanayake
Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/
Mobile : +94 777 24 73 39 | +94 718 74 44 08
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Correct formats of x-www-form-urlencoded

2018-01-03 Thread Thusitha Thilina Dayaratne
Hi Senduran,

IMHO x-www-form-urlencodedis for simple key value pairs. When the payload
is complicated, we should use multipart/form-data instead of
x-www-form-urlencoded content type. It can handle any complex complex
scenarios that you mentioned.

Thanks
Thusitha

On Wed, Jan 3, 2018 at 4:50 PM, Senduran Balasubramaniyam  wrote:

> Hi all,
>
> When an XML or a JSON is converted to  x-www-form-urlencoded format the
> key value pair is created.
> i.e
>
> 
>   value1
>   value2
> 
>
> will be converted to key1=value=value2
>
> similarly
>
> {"key1" : "value1", "key2" : "value2"} also get converted to
> key1=value=value2
>
> But what if the XML or JSON is not only having simple key value i.e having
> an array or a child element
>
> for example,
> 
>   value1
>   
> subvalue1
> subvalue2
>   
> 
>
> similarly for JSON like
> {"key1" : "value1", "key2" : {"subkey1" : "subvalue1"}} or
>
> JSON with array
> {"key1" : "value1", "key2" : ["arrayvalue1", "arrayvalue2"]}
>
>
> Kindly let me know the available correct formats for
> application/x-www-form-urlencoded content type.
> Further it will be really helpful if you could point to a specification or
> a standard document
>
> Thanks
> Senduran
>
>
> --
> *Senduran *
> Senior Software Engineer,
> WSO2, Inc.;  http://wso2.com/ 
> Mobile: +94 77 952 6548 <077%20952%206548>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


--
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Correct formats of x-www-form-urlencoded

2018-01-03 Thread Senduran Balasubramaniyam
Hi all,

When an XML or a JSON is converted to  x-www-form-urlencoded format the key
value pair is created.
i.e


  value1
  value2


will be converted to key1=value=value2

similarly

{"key1" : "value1", "key2" : "value2"} also get converted to
key1=value=value2

But what if the XML or JSON is not only having simple key value i.e having
an array or a child element

for example,

  value1
  
subvalue1
subvalue2
  


similarly for JSON like
{"key1" : "value1", "key2" : {"subkey1" : "subvalue1"}} or

JSON with array
{"key1" : "value1", "key2" : ["arrayvalue1", "arrayvalue2"]}


Kindly let me know the available correct formats for
application/x-www-form-urlencoded content type.
Further it will be really helpful if you could point to a specification or
a standard document

Thanks
Senduran


-- 
*Senduran *
Senior Software Engineer,
WSO2, Inc.;  http://wso2.com/ 
Mobile: +94 77 952 6548
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev