GithubHelp home page GithubHelp logo

Comments (2)

Dawid-Witkowski avatar Dawid-Witkowski commented on August 24, 2024 1

Resolved my issue, thanks :)

from fake-store-api.

federicoviceconti avatar federicoviceconti commented on August 24, 2024

Hi @dawwit0001! I think the problem is the lastname parameter and change the data method parameter to json, like the example below:

import requests

x = requests.put('https://fakestoreapi.com/users/7',
                 json={
                     'email': '[email protected]',
                     'username': 'johnd',
                     'password': 'password',
                     'name': {
                         'firstname': 'John',
                         'lastname': 'Doe'
                     },
                     'address': {
                         'city': 'kilcoole',
                         'street': '7835 new road',
                         'number': '3',
                         'geolocation': {
                             'lat': '-37.3159',
                             'long': '81.1496'
                         }
                     },
                     'phone': '1-570-236-7033'
                 })

print(x)

For Postman, import this cURL:

curl --location --request PUT 'https://fakestoreapi.com/users/7' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "username": "johnd",
    "password": "password",
    "name": {
        "firstname": "John",
        "lastname": "Doe"
    },
    "address": {
        "city": "kilcoole",
        "street": "7835 new road",
        "number": "3",
        "geolocation": {
            "lat": "-37.3159",
            "long": "81.1496"
        }
    },
    "phone": "1-570-236-7033"
}'

from fake-store-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.