<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sumit kumar on Medium]]></title>
        <description><![CDATA[Stories by Sumit kumar on Medium]]></description>
        <link>https://medium.com/@brotherSumit?source=rss-2fcb1a94ad0c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lEvcAIu19nSj-ePkZjnlYw.jpeg</url>
            <title>Stories by Sumit kumar on Medium</title>
            <link>https://medium.com/@brotherSumit?source=rss-2fcb1a94ad0c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:23:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brotherSumit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Dreams Help You Learn]]></title>
            <link>https://medium.com/@brotherSumit/dreams-help-you-learn-5822d3bda304?source=rss-2fcb1a94ad0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5822d3bda304</guid>
            <category><![CDATA[dreams]]></category>
            <category><![CDATA[curl]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Sumit kumar]]></dc:creator>
            <pubDate>Sun, 01 Aug 2021 17:08:43 GMT</pubDate>
            <atom:updated>2022-02-11T02:02:37.638Z</atom:updated>
            <content:encoded><![CDATA[<p>You believe or not but our brain can teach itself in dream. It happened to me many times. My brain corrected my logics, while I was sleeping. Here I would like to share one of my stories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*PNPOh1x3Yxd68f2qTBNvTQ.jpeg" /></figure><p>Have you ever heard about rest-API requests? In simple language, these are the requests we send to server in order to get specified response. For example to get the cat facts from <a href="https://catfact.ninja/">catfact.ninja</a> I sent a HTTP request via <a href="https://www.postman.com/">POSTMAN</a> tool with the URL “<a href="https://catfact.ninja/fact?max_length=140">https://catfact.ninja/fact?max_length=140</a>” &amp; parameter “max_length=140”. Below image is showing this typical example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOvJT9cCkdZOVlTozRbTjA.png" /><figcaption>Showing rest-API request response</figcaption></figure><p>Now, the story begins here, the API request which I sent above can be sent by different ways in real scenario. In terms of programming language this request can be make with <a href="https://curl.se/">CURL</a> (curl is used in command lines or scripts to transfer data). For the above request the curl code is:</p><p>curl — location — request GET ‘https://catfact.ninja/fact?max_length=140&#39; \ — header ‘Accept: application/json’</p><p>This code can be imported in <a href="https://www.postman.com/">Postman</a> (a collaboration platform for API development) by selecting “raw text” and click “continue” to import.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQ_O5_HobzV5MckaYCUxfw.png" /><figcaption>Generating code snippet for PHP-curl in Postman</figcaption></figure><p>In <a href="https://www.php.net/">PHP</a> programming language we can send this request with the code snippet which I have shown in above image is given below.</p><p><strong>&lt;?php</strong></p><p>$curl = curl_init();</p><p>curl_setopt_array($curl, <strong>array</strong>(</p><p>CURLOPT_URL =&gt; ‘https://catfact.ninja/fact?max_length=140&#39;,</p><p>CURLOPT_RETURNTRANSFER =&gt; <strong>true</strong>,</p><p>CURLOPT_ENCODING =&gt; ‘’,</p><p>CURLOPT_MAXREDIRS =&gt; 10,</p><p>CURLOPT_TIMEOUT =&gt; 0,</p><p>CURLOPT_FOLLOWLOCATION =&gt; <strong>true</strong>,</p><p>CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,</p><p>CURLOPT_CUSTOMREQUEST =&gt; ‘GET’,</p><p>CURLOPT_HTTPHEADER =&gt; <strong>array</strong>(</p><p>‘Accept: application/json’</p><p>),</p><p>));</p><p>$response = curl_exec($curl);</p><p>curl_close($curl);</p><p><strong>echo</strong> $response;<br>?&gt;</p><p><a href="https://www.postman.com/">Postman</a> is really an amazing tool/application to generate the code snippet for different languages like PHP, jQuery, JavaScript, NodeJS, C, etc. For NodeJS we can generate code snippet as shown in below image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vIe68WbE_UYFdvdMfsQy5w.png" /><figcaption>Generating code snippets for NodeJS in postman</figcaption></figure><p>I always used this method only for PHP. I don’t know why?… May be I don&#39;t have a proper understanding of it, but, yesterday, In my Dream it automatically came to my mind that this code snippets can be generated for other languages as well as shown in above image. Lol!!!</p><p>Now, onward, I will be using curl for other languages too. <strong>Hence, we can say that our brain teaches itself while we sleep. Not only the fantasy but the technical and logical things also fixed in mind.</strong> Thanks to a process Harvard neuroscience professor Robert Stickgold calls <a href="https://pubmed.ncbi.nlm.nih.gov/11691983/"><strong>off-line memory reprocessing</strong></a>. Refer to <a href="https://www.mentalfloss.com/article/51228/5-actual-facts-about-science-dreams">this</a> for more about <a href="https://www.mentalfloss.com/article/51228/5-actual-facts-about-science-dreams">5 Scientific Facts About Your Dreams</a>.</p><p>Thank you so much for given me your valuable time &amp; reading my story!!! I hope, It also happened to you in your dream like this, If yes then share with me. Thanks in advance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5822d3bda304" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>