Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
POSTMAN PUT request not updating values

Assuming the position of the API tester of https://imgur.com/ , Im testing the PUT request to change account settings. I am following this api doc enter image description here Link for above https://apidocs.imgur.com/#7bc88d39-d06d-4661-afff-38ea5b9a1d0a

Steps to check this

  1. Add the relevant info as below, I am setting show_mature and newsletter_subscribed to true

enter image description here 2. Set the Access token enter image description here 3. Click on send the response for this is 200 as shown below enter image description here

  1. Check if the details have updated as shown in the following screenshot enter image description here

Expected: To have show_mature and newsletter_subscribed values set to true Actual: show_mature and newsletter_subscribed values are false

Would be really appreciated if someone could let me know why this is happening? Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

From the Imgur API docs...

Need help?

The Imgur engineers are always around answering questions. The quickest way to get help is by posting your question on StackOverflow with the Imgur tag.

Real helpful Imgur 🙄.

Answering here to provide a canonical answer in the imgur tag for this nonsense.

All the API examples in the documentation use some form of multipart/form-data request body payloads. Eg

var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{accessToken}}");

var formdata = new FormData();

var requestOptions = {
  method: 'PUT',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.imgur.com/3/account/{{username}}/settings", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

and

curl --location --request POST 'https://api.imgur.com/oauth2/token' \
--form 'refresh_token="{{refreshToken}}"' \
--form 'client_id="{{clientId}}"' \
--form 'client_secret="{{clientSecret}}"' \
--form 'grant_type="refresh_token"'

With the exception of any upload related endpoints, this is ABSOLUTELY INCORRECT. Passing data as multipart/form-data requires the API to handle that request content-type and guess what, the Imgur API does not.

What they do accept is application/x-www-form-urlencoded.

  • In Postman that's the x-www-form-urlencoded option, not form-data
  • In cURL that's the -d option, not --form
  • In JavaScript that's URLSearchParams, not FormData
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda