php - Best way to send JSON data. -


मेरे पास एक url है

  http://example.com/data/   

मैं उस यूआरएल में जेएसएन डेटा भेजना चाहता हूं अर्थात।

  http://example.com/data/ {"1": {"id ":" some_id "," xyz ":" 1 "," दिनांक ":" 13 9 7287235418 "," प्रकार ":" 67878 "}}   

json भेजने का सबसे अच्छा तरीका क्या है यूआरएल में डेटा क्योंकि जब मैं इस प्रारूप में डेटा भेजने का प्रयास करता हूं तो यह त्रुटि देता है

आपके द्वारा सबमिट की गई यूआरआई को अनुमति नहीं है।

मुझे पता है सीआई में चरित्र कॉन्फ़िगरेशन की अनुमति है लेकिन अगर मैं अनुमति देता हूं तो एक सुरक्षा समस्या होगी मैंने urlencode की कोशिश की है और सर्वर पक्ष में urldecode का इस्तेमाल किया है लेकिन यह पहले से धन्यवाद में मदद नहीं कर रहा है।

php में कच्चेरलेनकोड फ़ंक्शन से बचें अमान्य वर्ण। उदाहरण के लिए,

  & lt;? Php $ str = '{"1": {"id": "some_id", "xyz": "1", "दिनांक": "13 9 7287235418" , "type": "67878"}} '; $ Str2 = rawurlencode ($ str); ? & Gt; & lt; a href = "/ डेटा / & lt;? php echo $ str2;; ​​& gt;" & gt; LINK & lt; / a & gt;   

यह यूआरएल दिखाता है

  http://example.com/data/%7B%221%22%3A%7B%22id%22% 3 ए% 22 एसएमआईआईडी% 22% 2 सी% 22xyz% 22% 3 ए% 221% 22% 2 सी% 22 दिन% 22% 3 ए% 221397287235418% 22% 2 सी% 22 प्रकार% 22% 3 ए% 2267878% 22% 7 डी% 7 डी /    

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -