Giter Site home page Giter Site logo

Custom Headers about cf7-to-api HOT 1 CLOSED

kennym avatar kennym commented on June 21, 2024
Custom Headers

from cf7-to-api.

Comments (1)

o-data avatar o-data commented on June 21, 2024

Hi guys,

Good news, I figured out how to do it since there were no response. Here is the guide to add your custom headers.

Go to your file manager (or make these edit before uploading to your Wordpress website). Assuming it is uploaded then make the edit to this file (this guide is applicable to version 1.4.6 only, I think it general work for all version).

\wp-content\plugins\cf7-to-api-basic-auth\includes\class-cf7-api-admin.php

Around lines 561 you should see this code:

      if( $record_type == "json" ){

        $args['headers']['Content-Type'] = 'application/json';

Now I want to add another custom headers in here, I would change from up to this:


      if( $record_type == "json" ){

        $args['headers']['Content-Type'] = 'application/json';
        $args['headers']['Accept'] = 'application/json';

Save file, do a test and see if it work. For me it did because my server require that "Accept" header.

I close this now since issue is resolve.

from cf7-to-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.