Jump to content

POST request doesn't works from postman


Recommended Posts

Hello,

I have a problem, when I make a POST request from postman to the webservice, i only receive a response like I send a GET request, but nothing is created.

All my GET request work perfectly, it's only for the POST request.

Did anyone have the same problem and find a solution ?

Thx

Link to comment
Share on other sites

ok, i send post request to create a customer with the webservice of PrestaShop, i include in the body of the request :

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    <customer>
    	<id>17</id>
        <id_default_group></id_default_group>
        <id_lang></id_lang>
        <newsletter_date_add></newsletter_date_add>
        <ip_registration_newsletter></ip_registration_newsletter>
        <last_passwd_gen></last_passwd_gen>
        <secure_key></secure_key>
        <deleted></deleted>
        <passwd>123456789</passwd>
        <lastname>Presta</lastname>
        <firstname>Presta</firstname>
        <email>[email protected]</email>
        <id_gender></id_gender>
        <birthday></birthday>
        <newsletter></newsletter>
        <optin></optin>
        <website></website>
        <company></company>
        <siret></siret>
        <ape></ape>
        <outstanding_allow_amount></outstanding_allow_amount>
        <show_public_prices></show_public_prices>
        <id_risk></id_risk>
        <max_payment_days></max_payment_days>
        <active></active>
        <note></note>
        <is_guest></is_guest>
        <id_shop></id_shop>
        <id_shop_group></id_shop_group>
        <date_add></date_add>
        <date_upd></date_upd>
        <reset_password_token></reset_password_token>
        <reset_password_validity></reset_password_validity>
        <associations>
            <groups>
                <group>
                    <id></id>
                </group>
            </groups>
        </associations>
    </customer>
</prestashop>

and i receive the list of customer without create :

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    <customers>
        <customer id="11" xlink:href="https://www.langeline.co/api/customers/11"/>
        <customer id="12" xlink:href="https://www.langeline.co/api/customers/12"/>
        <customer id="13" xlink:href="https://www.langeline.co/api/customers/13"/>
        <customer id="14" xlink:href="https://www.langeline.co/api/customers/14"/>
        <customer id="15" xlink:href="https://www.langeline.co/api/customers/15"/>
.... ....
        <customer id="253" xlink:href="https://www.langeline.co/api/customers/253"/>
        <customer id="254" xlink:href="https://www.langeline.co/api/customers/254"/>
        <customer id="255" xlink:href="https://www.langeline.co/api/customers/255"/>
        <customer id="256" xlink:href="https://www.langeline.co/api/customers/256"/>
        <customer id="257" xlink:href="https://www.langeline.co/api/customers/257"/>
    </customers>
</prestashop>

lthe status id 200 ok like i make a get request

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...