• Hi Steve,

    I’m pulling my hair out trying to get the Streetshirts site to send products to my WordPress site. I’ve tried enabling Basic Auth and all the suggested .htaccess changes I can find with no joy. I get the following error and if there’s any possibility of you looking at this for me (and I would pay!) I’d be grateful.

    Thanks, Andrew

    {“code”:”woocommerce_rest_cannot_create”,”message”:”Sorry, you are not allowed to create resources.”,”data”:{“status”:401}}
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.WebException: {“code”:”woocommerce_rest_cannot_create”,”message”:”Sorry, you are not allowed to create resources.”,”data”:{“status”:401}}

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [WebException: {“code”:”woocommerce_rest_cannot_create”,”message”:”Sorry, you are not allowed to create resources.”,”data”:{“status”:401}}]
    WooCommerceNET.<SendHttpClientRequest>d__20`1.MoveNext() +3092
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
    WooCommerceNET.WooCommerce.v1.<PostProduct>d__38.MoveNext() +425
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
    Streetshirts_Connect.ext.woo.<btnAddProduct_Click>d__10.MoveNext() in D:\Source\streetshirtsAPI\API Web App\Streetshirts Connect\Streetshirts Connect\ext\woo\add_product_4.aspx.cs:233
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
    System.Web.Util.SynchronizationHelper.SafeWrapCallback(Action action) +109
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
    System.Web.Util.WithinCancellableCallbackTaskAwaiter.GetResult() +32
    System.Web.UI.<ProcessRequestMainAsync>d__523.MoveNext() +9060

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • You can try editing your .htaccess file

    Add the following line

    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    It needs to come right after the rewrite engine on rule

    As a result your .htaccess might look a little something like this:

    # BEGIN WordPress
    # The directives (lines) between BEGIN WordPress and END WordPress are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

Viewing 1 replies (of 1 total)
  • The topic ‘Posting products 401 error’ is closed to new replies.