{"id":1431,"date":"2017-09-23T21:54:00","date_gmt":"2017-09-23T21:54:00","guid":{"rendered":"http:\/\/inchoo.net\/?p=30055"},"modified":"2017-09-23T22:47:02","modified_gmt":"2017-09-23T22:47:02","slug":"validate-a-custom-form-in-magento-2","status":"publish","type":"post","link":"https:\/\/www.sushilkumar.ind.in\/blog\/magento-2\/validate-a-custom-form-in-magento-2\/","title":{"rendered":"Validate a custom form in Magento 2"},"content":{"rendered":"<p>This article will cover the fundamentals of validating any form in Magento 2.<\/p>\n<p><span style=\"font-weight: 400;\">The contact form on Contact us page will be used and modified for the purpose of the article. The form itself can be found in the following paths, depending on the type of installation you are using:<\/span><span id=\"more-30055\"><\/span><\/p>\n<ul>\n<li><code>app\/code\/Magento\/Contact\/view\/frontend\/templates\/form.phtml<\/code><\/li>\n<li><code>vendor\/magento\/module-contact\/view\/frontend\/templates\/form.phtml<\/code><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">In order to demonstrate how to get the forms to be validated, let\u2019s create a validation-free form with some fields. Copy the file from one of the paths above and paste it into your theme:<\/span><\/p>\n<ul>\n<li><code>app\/code\/VENDOR\/THEME\/Magento_Contact\/frontend\/templates\/form.phtml<\/code><\/li>\n<\/ul>\n<p>Next, paste the following code inside of it:<\/p>\n<pre class=\"ish\"><code class=\"language-php\">&lt;form class=\"form contact-sushil\" action=\"<span class=\"kw2\">&lt;?php<\/span> <span class=\"coMULTI\">\/* @escapeNotVerified *\/<\/span> <span class=\"kw1\">echo<\/span> <span class=\"re0\">$block<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">getFormAction<\/span><span class=\"br0\">(<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span> <span class=\"sy1\">?&gt;<\/span>\" id=\"contact-form\" method=\"post\" data-hasrequired=\"* Required Fields\"&gt; &lt;fieldset class=\"fieldset\"&gt; &lt;div class=\"field name required\"&gt; &lt;label class=\"label\" for=\"field1\"&gt;&lt;span&gt;Field 1 (using data-validate)&lt;\/span&gt;&lt;\/label&gt; &lt;div class=\"control\"&gt; &lt;input name=\"field1\" id=\"field1\" title=\"Field 1\" value=\"\" class=\"input-text\" type=\"text\" \/&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;div class=\"field name required\"&gt; &lt;label class=\"label\" for=\"field2\"&gt;&lt;span&gt;Field 2 (using attribute)&lt;\/span&gt;&lt;\/label&gt; &lt;div class=\"control\"&gt; &lt;input name=\"field2\" id=\"field2\" title=\"Field 2\" value=\"\" class=\"input-text\" type=\"text\" \/&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;div class=\"field name required\"&gt; &lt;label class=\"label\" for=\"field3\"&gt;&lt;span&gt;Field 3 (using classname)&lt;\/span&gt;&lt;\/label&gt; &lt;div class=\"control\"&gt; &lt;input name=\"field3\" id=\"field3\" title=\"Field 2\" value=\"\" type=\"text\" class=\"input-text\" \/&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;div class=\"field name required\"&gt; &lt;label class=\"label\" for=\"field4\"&gt;&lt;span&gt;Field 4 (using data-mage-init)&lt;\/span&gt;&lt;\/label&gt; &lt;div class=\"control\"&gt; &lt;input name=\"field4\" id=\"field4\" title=\"Field 4\" value=\"\" class=\"input-text\" type=\"text\" \/&gt; &lt;\/div&gt; &lt;\/div&gt; <span class=\"kw2\">&lt;?php<\/span> <span class=\"kw1\">echo<\/span> <span class=\"re0\">$block<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">getChildHtml<\/span><span class=\"br0\">(<\/span><span class=\"st_h\">'form.additional.info'<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span> <span class=\"sy1\">?&gt;<\/span> &lt;\/fieldset&gt; &lt;div class=\"actions-toolbar\"&gt; &lt;div class=\"primary\"&gt; &lt;input type=\"hidden\" name=\"hideit\" id=\"hideit\" value=\"\" \/&gt; &lt;button type=\"submit\" title=\"Submit\" class=\"action submit primary\"&gt; &lt;span&gt;Submit&lt;\/span&gt; &lt;\/button&gt; &lt;\/div&gt; &lt;\/div&gt;\r\n&lt;\/form&gt;<\/code><\/pre>\n<p>Your form should look like this one:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30057\" src=\"\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/validate-a-custom-form-in-magento-2.png\" alt=\"\" width=\"600\" height=\"400\" \/><\/p>\n<p><span style=\"font-weight: 400;\">If you click the \u201cSubmit\u201d button, the form would be submitted.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Step 1: add the validation component<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Add this attribute on the form tag:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><code>data-mage-init='{\"validation\":{}}'<\/code><\/span><\/p>\n<p><span style=\"font-weight: 400;\">This one data attribute tells Magento that the form must be validated before submit and that \u00a0<\/span><span style=\"font-weight: 400;\"><code>validation<\/code><\/span><span style=\"font-weight: 400;\"> alias should invoke some particular file using RequireJS. If you take a look at the page source of the compiled file RequireJS config file (found in <\/span><span style=\"font-weight: 400;\"><code>pub\/static\/frontend\/VENDOR\/THEME\/LOCALE\/requirejs-config.json<\/code><\/span><span style=\"font-weight: 400;\">), you should be able to find the following snippet:<\/span><\/p>\n<pre class=\"ish\"><code class=\"language-javascript\"><span class=\"kw1\">var<\/span> config <span class=\"sy0\">=<\/span> <span class=\"br0\">{<\/span> map<span class=\"sy0\">:<\/span> <span class=\"br0\">{<\/span> <span class=\"st0\">\"*\"<\/span><span class=\"sy0\">:<\/span> <span class=\"br0\">{<\/span> ... <span class=\"st0\">\"validation\"<\/span><span class=\"sy0\">:<\/span> <span class=\"st0\">\"mage\/validation\/validation\"<\/span><span class=\"sy0\">,<\/span> ... <span class=\"br0\">}<\/span> <span class=\"br0\">}<\/span> ...\r\n<span class=\"br0\">}<\/span><span class=\"sy0\">;<\/span><\/code><\/pre>\n<p>The string\u00a0on the right of the <code>validation<\/code> alias matches the <code>lib\/web\/mage\/validation\/validation.js<\/code> file that will load entire validation logic and take care of your input fields.<\/p>\n<h2><span style=\"font-weight: 400;\">Step 2: add some validation rules to your input fields<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">By looking at the code of validation logic, Magento made it possible to set validation rule names by using one of the following methods listed here:<\/span><\/p>\n<ol>\n<li>method #1 \u2013 by setting <code>data-validate<\/code> attribute on the input field:\n<pre class=\"ish\"><code class=\"language-php\"><span class=\"sy0\">&lt;<\/span>input data<span class=\"sy0\">-<\/span>validate<span class=\"sy0\">=<\/span><span class=\"st_h\">'{\"required\":true}'<\/span>name<span class=\"sy0\">=<\/span><span class=\"st0\">\"field1\"<\/span> id<span class=\"sy0\">=<\/span><span class=\"st0\">\"field1\"<\/span> <span class=\"sy0\">...<\/span> <span class=\"sy0\">\/&gt;<\/span><\/code><\/pre>\n<\/li>\n<li>method #2 \u2013 by setting the rule names as attributes:\n<pre class=\"ish\"><code class=\"language-php\"><span class=\"sy0\">&lt;<\/span>input required<span class=\"sy0\">=<\/span><span class=\"st0\">\"true\"<\/span> name<span class=\"sy0\">=<\/span><span class=\"st0\">\"field2\"<\/span> id<span class=\"sy0\">=<\/span><span class=\"st0\">\"field2\"<\/span> <span class=\"sy0\">...<\/span> <span class=\"sy0\">\/&gt;<\/span><\/code><\/pre>\n<\/li>\n<li>method #3 \u2013 by setting the rule names as classnames:\n<pre class=\"ish\"><code class=\"language-php\"><span class=\"sy0\">&lt;<\/span>input <span class=\"kw2\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">\"input-text required\"<\/span> name<span class=\"sy0\">=<\/span><span class=\"st0\">\"field3\"<\/span> id<span class=\"sy0\">=<\/span><span class=\"st0\">\"field3\"<\/span> <span class=\"sy0\">...<\/span> <span class=\"sy0\">\/&gt;<\/span><\/code><\/pre>\n<\/li>\n<li>method #4 \u2013 by setting the rules inside of the data-mage-init attribute on the form tag\n<pre class=\"ish\"><code class=\"language-php\"><span class=\"sy0\">&lt;<\/span>form <span class=\"sy0\">...<\/span> data<span class=\"sy0\">-<\/span>mage<span class=\"sy0\">-<\/span>init<span class=\"sy0\">=<\/span><span class=\"st_h\">'{ \"validation\":{ \"rules\": { \"field4\": { \"required\":true } } }\r\n}'<\/span><span class=\"sy0\">&gt;<\/span><\/code><\/pre>\n<\/li>\n<\/ol>\n<p>Now when you submit your form, all of the fields should be invalid, like on the image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30074\" src=\"\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/validate-a-custom-form-in-magento-2-1.png\" alt=\"\" width=\"554\" height=\"506\" \/><\/p>\n<h2>Rules with arguments<\/h2>\n<p><span style=\"font-weight: 400;\">If you have to use a rule that requires a parameter (for example, <\/span><span style=\"font-weight: 400;\">minlength<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">maxlength<\/span><span style=\"font-weight: 400;\"> and many other) you can use one of the following three methods, which ever you prefer:<\/span><\/p>\n<ul>\n<li>method #1\n<pre class=\"ish\"><code class=\"language-php\">data<span class=\"sy0\">-<\/span>validate<span class=\"sy0\">=<\/span><span class=\"st_h\">'{ \"required\":true, \"minlength\":10\r\n}'<\/span><\/code><\/pre>\n<\/li>\n<li>method #2\n<pre class=\"ish\"><code class=\"language-php\">required<span class=\"sy0\">=<\/span><span class=\"st0\">\"true\"<\/span> minlength<span class=\"sy0\">=<\/span><span class=\"st0\">\"15\"<\/span><\/code><\/pre>\n<\/li>\n<li>method #4 \u2013\u00a0<span style=\"font-weight: 400;\">you have to manually specify name attribute of each input field which rules are applied (which is already taken care of if you use it inline with <\/span><span style=\"font-weight: 400;\">data-validate <\/span><span style=\"font-weight: 400;\">attribute)<\/span>\n<pre class=\"ish\"><code class=\"language-php\">data<span class=\"sy0\">-<\/span>mage<span class=\"sy0\">-<\/span>init<span class=\"sy0\">=<\/span><span class=\"st_h\">'{ \"validation\":{ \"rules\": { \"field4\": { \"required\":true, \"minlength\":20 } } }\r\n}'<\/span><\/code><\/pre>\n<\/li>\n<\/ul>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30079\" src=\"\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/validate-a-custom-form-in-magento-2-2.png\" alt=\"\" width=\"583\" height=\"473\" \/><\/h2>\n<h2>List of form validation rules<\/h2>\n<p>To wrap up this article, a list of validation rule names is\u00a0provided here as a quick reference toward the official documentation:<\/p>\n<ol>\n<li>jQuery rules:\n<ol>\n<li>required,<\/li>\n<li>remote,<\/li>\n<li>email,<\/li>\n<li>url,<\/li>\n<li>date,<\/li>\n<li>dateISO,<\/li>\n<li>number,<\/li>\n<li>digits,<\/li>\n<li>creditcard,<\/li>\n<li>equalTo,<\/li>\n<li>maxlength,<\/li>\n<li>minlength,<\/li>\n<li>rangelength,<\/li>\n<li>range,<\/li>\n<li>max,<\/li>\n<li>min<\/li>\n<\/ol>\n<\/li>\n<li>Magento rules:\n<ol>\n<li><span style=\"font-weight: 400;\">max-words<\/span><\/li>\n<li><span style=\"font-weight: 400;\">min-words<\/span><\/li>\n<li><span style=\"font-weight: 400;\">range-words<\/span><\/li>\n<li><span style=\"font-weight: 400;\">letters-with-basic-punc<\/span><\/li>\n<li><span style=\"font-weight: 400;\">alphanumeric<\/span><\/li>\n<li><span style=\"font-weight: 400;\">letters-only<\/span><\/li>\n<li><span style=\"font-weight: 400;\">no-whitespace<\/span><\/li>\n<li><span style=\"font-weight: 400;\">zip-range<\/span><\/li>\n<li><span style=\"font-weight: 400;\">integer<\/span><\/li>\n<li><span style=\"font-weight: 400;\">vinUS<\/span><\/li>\n<li><span style=\"font-weight: 400;\">dateITA<\/span><\/li>\n<li><span style=\"font-weight: 400;\">dateNL<\/span><\/li>\n<li><span style=\"font-weight: 400;\">time<\/span><\/li>\n<li><span style=\"font-weight: 400;\">time12h<\/span><\/li>\n<li><span style=\"font-weight: 400;\">phoneUS<\/span><\/li>\n<li><span style=\"font-weight: 400;\">phoneUK<\/span><\/li>\n<li><span style=\"font-weight: 400;\">mobileUK<\/span><\/li>\n<li><span style=\"font-weight: 400;\">stripped-min-length<\/span><\/li>\n<li><span style=\"font-weight: 400;\">email2<\/span><\/li>\n<li><span style=\"font-weight: 400;\">url2<\/span><\/li>\n<li><span style=\"font-weight: 400;\">credit-card-types<\/span><\/li>\n<li><span style=\"font-weight: 400;\">ipv4<\/span><\/li>\n<li><span style=\"font-weight: 400;\">ipv6<\/span><\/li>\n<li><span style=\"font-weight: 400;\">pattern<\/span><\/li>\n<li><span style=\"font-weight: 400;\">allow-container-className<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-no-html-tags<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-select<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-no-empty<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-alphanum-with-spaces<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-data<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-street<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-phoneStrict<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-phoneLax<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-fax<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-email<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-emailSender<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-password<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-admin-password<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-customer-password<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-url<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-clean-url<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-xml-identifier<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-ssn<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-zip-us<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-date-au<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-currency-dollar<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-not-negative-number<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-zero-or-greater<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-greater-than-zero<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-css-length<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-number<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-number<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-number-range<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-digits<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-digits-range<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-range<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-alpha<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-code<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-alphanum<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-date<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-date-range<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cpassword<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-identifier<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-zip-international<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-one-required<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-state<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-file<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-ajax-error<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-optional-datetime<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-required-datetime<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-one-required-by-name<\/span><\/li>\n<li><span style=\"font-weight: 400;\">less-than-equals-to<\/span><\/li>\n<li><span style=\"font-weight: 400;\">greater-than-equals-to<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-emails<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cc-type-select<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cc-number<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cc-type<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cc-exp<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cc-cvn<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-cc-ukss<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-length<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-entry<\/span><\/li>\n<li><span style=\"font-weight: 400;\">not-negative-amount<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-per-page-value-list<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-per-page-value<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-new-password<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-if-not-specified<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-if-all-sku-empty-and-file-not-loaded<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-if-specified<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-number-if-specified<\/span><\/li>\n<li><span style=\"font-weight: 400;\">datetime-validation<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-text-swatch-entry<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-visual-swatch-entry<\/span><\/li>\n<li><span style=\"font-weight: 400;\">required-dropdown-attribute-entry<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Validate-item-quantity<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-grouped-qty<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-one-checkbox-required-by-name<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-date-between<\/span><\/li>\n<li><span style=\"font-weight: 400;\">validate-dob<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>Congratulations, you have reached the end of this article! If you have any questions, feel free to post a comment below.<\/p>\n<p>The post Validate a custom form in Magento 2 appeared first on Sushil Kumar.<\/p>\n<p><a href=\"\/\/www.sushilkumar.ind.in\/custome-devlopment\/\">Do you need any custome Development Click here and fill the form with full your requirement<\/a> and after i will send the quotes of your work requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will cover the fundamentals of validating any form in Magento 2. The contact form on Contact us page will be used and modified for the purpose of the article. The form itself can be found in the following paths, depending on the type of installation you are using: app\/code\/Magento\/Contact\/view\/frontend\/templates\/form.phtml vendor\/magento\/module-contact\/view\/frontend\/templates\/form.phtml In order to&#8230;<br \/>\nThe post Validate a custom form in Magento 2 appeared first on Inchoo. Do you need any custome Development Click here and fill the form with full your requirement  and after i will send the quotes of your work requirements&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":1432,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[269,225,20,257,270],"tags":[271,230,22,261,272],"class_list":["post-1431","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-custom-form","category-frontend","category-magento-2","category-programming","category-validation","tag-custom-form","tag-frontend","tag-magento-2","tag-programming","tag-validation"],"jetpack_publicize_connections":[],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/validate-a-custom-form-in-magento-2.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p99pkJ-n5","_links":{"self":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts\/1431"}],"collection":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/comments?post=1431"}],"version-history":[{"count":0,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts\/1431\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/media\/1432"}],"wp:attachment":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/media?parent=1431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/categories?post=1431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/tags?post=1431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}