+91 9422537131 | info@adhvik.online |
Sports Sagaa | Simplicity Global Services Register
29 Aug 19 by Administrator 162
use following code in web.config
<system.webServer>
 <httpProtocol>  
    <customHeaders>  
     <add name="Access-Control-Allow-Origin" value="*" />  
     <add name="Access-Control-Allow-Headers" value="Content-Type" />  
     <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />  
    </customHeaders>  
  </httpProtocol>         
</system.webServer>


Because 
$.ajax({type: "POST" - Calls OPTIONS 
$.post( - Calls POST 

both are different Postman calls "POST" properly but when we call it will be "OPTIONS"

For c# web services - webapi

Please add the following code in your web.config file under <system.webServer> tag. This will work

<httpProtocol>
    <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
    </customHeaders>
</httpProtocol>

Please make sure you are not doing any mistake in the ajax call

jQuery

$.ajax({
    url: 'http://mysite.microsoft.sample.xyz.com/api/mycall',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    type: "POST", /* or type:"GET" or type:"PUT" */
    dataType: "json",
    data: {
    },
    success: function (result) {
        console.log(result);    
    },
    error: function () {
        console.log("error");
    }
});

Tags:
Share Post
03 Jan 20 by Administrator 79
ALTER TABLE Item ADD ILink varchar(3500)ALTER TABLE Item ADD IDImages varchar(7000) ALTER TABLE generalsettings ADD GLink varchar(3500) GO ALTER VIEW [dbo].[vItem]ASSELECT i1.ILink,i1.CompanyId, i1
15 Sep 19 by Administrator 182
For every news portal use dimension as 100, 480, 800 Approximage Image Sizes  : 2.8, 36.3, 83 Total: 140 kb for single news use 800 for multiple news use 480 and for thumb and lazy load us
02 Oct 19 by Administrator 187
insert into posts select companyid, ptypeid, postid, langid, lpostid1,lpostid2,plink, forid, ppostid,ptitle,pshort,pfull,postedby,metakey,metadescription,metadata,sortorder,postdate,postrate,totalview
03 Oct 19 by Administrator 174
2019 standards thanks to faviconit I use faviconit.com for the best browser and device support possible. You upload an image and this site gives you the code, the converted images and
07 Jul 19 by Administrator 226
ddf" data-defaultdata="['Unmarried', 'Married', 'Divorced'] ddf" data-defaultdata="[{id:'M', 'text':'Male'}, {'id':'F', text:'Female'},{'id':'O', 'text':'Other'} ]" autofocus="autofocus ddl" val
12590

We are simpliy creative. We create stunning identities for our clients that people recommand.

Login
×
Remember me
Forgot password?