Welcome Guest, Not a member yet? Register   Sign In
Error Put method from App in reactNative an RESTAPI CI4
#4

(This post was last modified: 06-15-2021, 12:55 AM by InsiteFX.)

If it is a CORS problem I use this in my .htaccess file in the root with index.php

Code:
    ## For CORS Configuration

    # Add Font Types
    AddType application/vnd.ms-fontobject .eot
    AddType application/x-font-ttf        .ttf
    AddType application/x-font-opentype  .otf
    AddType application/font-woff        .woff
    AddType application/font-woff2        .woff2

    <IfModule mod_headers.c>
        <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg|svgz|jpg|png|ico|font.css|css|js)$">
            ## un-remark this one for all access and remark out the one below it
            #Header set Access-Control-Allow-Origin "*"
            ## Change this to your url. and https or http
            Header add Access-Control-Allow-Origin: "https://your-domain.com"
            Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
            Header add Access-Control-Allow-Headers: "Upgrade-Insecure-Requests"
        </FilesMatch>
    </IfModule>

    # Remove index.php from URL
    RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
    RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
    RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]

Make sure that you change your-domain.com to your real URL.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Error Put method from App in reactNative an RESTAPI CI4 - by InsiteFX - 06-15-2021, 12:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB