Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Kai

    (@kaiono)

    Thank you. I double checked again but the slug was not mixed up.
    I found out that the meta data dissapears when I saved an array object inside.

    Thread Starter Kai

    (@kaiono)

    I figured out the problem.
    The Content-Type: multipart/form-data set in the Header was effecting the http request.
    When we excluded this parameter, we got the proper response.

    Just in case we checked our environment. I was using the native postman for mac and my co worker was using the chrome extension version of postman.

    Worked for both at the end!

    Thank you for your comments.

    Thread Starter Kai

    (@kaiono)

    Hi, thank you for your ideas.
    But I haven’t figured out my problem yet.

    I have checked our Content-Type status and both were something like below.

    
    Header
    Content-Type: multipart/form-data;
    Body
    Content-Disposition: form-data; name="user_id"
    123
    

    Im using a plugin to catch the logs for the API request called REST API Log and according to this the error log for my co worker has no body parameters in his request. this is strange.

    We also tried making a single page which fires the API using PHP just by opening it.The result was, my access was successful and my coworkers access log didn’t come up in the log data.

    Now we are guessing if there is some kind of IP address blocking system in wordpress or if there is a problem using the media_handle_upload function for the API request.
    Maybe the required file for this function is making a problem.Like the ones below.

    require_once(ABSPATH . "wp-admin" . '/includes/image.php');
    require_once(ABSPATH . "wp-admin" . '/includes/file.php');
    require_once(ABSPATH . "wp-admin" . '/includes/media.php');
    Thread Starter Kai

    (@kaiono)

    hmm I see.
    I’ll check if we have different settings on that.
    we are using an authorization token generated by the JWT Authentication for WP and this is set to the Header.

    Im also setting a required parameter in the schema of register_rest_route so the API doesn’t give a success response without a user id, but my co worker always get’s an error response with a message that he has’nt set a required parameter, even if he seems to be setting it in his form-data as far I an see from his settings in hs screen shot.

    Im stuck in this long tunnel.

    Thread Starter Kai

    (@kaiono)

    Thank you Jan!

    I was able to upload the media in the media library.

Viewing 5 replies - 1 through 5 (of 5 total)