26935

POST to /likes only works after GET - bug or by design?

Question:

My app has permissions to "like" something on FB on a user's behalf. Using the Facebook C# SDK (5.4.1), here's what I wrote:

Facebook.FacebookClient fb = new Facebook.FacebookClient(AccessToken); object o = fb.Get("1234567890_12345678901234567/likes"); dynamic parameters = new ExpandoObject(); dynamic success = fb.Post("1234567890_12345678901234567/likes", parameters);

The second line is superfluous and creates an unnecessary round-trip, as we're not interested in the other "likes" on the same object. However, without it, fb.Post fails and throws "The remote server returned an error: (400) Bad Request."

Is this a bug in the C# SDK, or a bug in the graph API, or is it by design?

Note that it's possible to POST to /comments without a previous GET.

Answer1:

Yes, it should be possible to do post commands without a get. Strangely enough, my like code with the 5.4.1 does not require the extra GET directly before the POST for doing a like. Maybe somewhere else in my app's flow I've already done some sort of GET via the API. However, I'm going to investigate my DELETE problem with me/permissions that I'm encountering (http://stackoverflow.com/questions/8598614/facebook-c-sharp-api-return-400-when-deauthorizing-app) and see if a get to the me/permissions first will help resolve that issue.

Recommend

  • Automating custom field value change in JIRA
  • Specific issue regarding MathJax, then (auto?) save to word or pdf
  • Multi Criterion Max If Statement
  • Jersey resource that matches any path
  • Uncaught ReferenceError: jQuery is not defined, even though jQuery is first imported script
  • Nginx downloads PHP
  • Downloading files as attachment filesize incorrect
  • Why laravel redirects to https even in local environment?
  • Pivot data using VBA
  • Creating a route in Laravel using subdomain and domain wildcards
  • JSON Naming issue using Lastfm API
  • In javascript how do you open a file from the server?
  • Launch angular 4 from Hapi js
  • grunt-serve change default path
  • Cant Access a “error” folder in subdomain.localhost/error/
  • Images in Watermark in Google App Engine (Java)
  • Deep cloning an object of a class in java
  • Router not working (Heroku + Nginx + PHP Phalcon)
  • My navigation bar is showing up in storyboard but not in the simulator
  • What is the best way to conditionally serve static files in Express?
  • Is serving a bot-friendly page to google-bot likely ot adversly affect SEO? [closed]
  • Get full URL in PHP to redirect to SSL
  • PATH_INFO in PHP without having file apparent
  • Make a destructive reverse! function in scheme
  • Using image in a template django
  • Why is Python strict about indentation? [closed]
  • Adding a integer after variable name to access
  • Django & static files while Debug mode is ON
  • Serving a 404 without redirecting to /404/
  • Post permalinks not being parsed in Jekyll on GitHub Pages
  • LINQ to XML attributes
  • trying to update mysql database in php
  • Syntax to Redirect to Input/Output to in C (UNIX)
  • “@” Decorator (in Python) [duplicate]
  • How to use Google libphonenumber in Typescript?
  • Change grunt serve default path
  • Subrequest for PHP-CGI
  • grunt build Aborted due to warning “Destination not written because minified HTML was empty” and “Pa
  • Displaying RTSP on website
  • what is std::identity and how it is used?
  • Form reset functionality in angular 5
  • Migrate one single project from On-premise TFS to VSTS
  • Restrict access to Node.js using Express
  • Saving Information - Swing Shapes
  • sorting excel data formulaicly
  • Is it possible to have too many functions in a PHP application?
  • How do I use Backbone.js for a multi-page web app?
  • Host Django on subfolder
  • Gitosis won't create repository
  • How to unzip .apk file programatically from mobile ? and how to insert a file into it?
  • How to retrieve a byte array from the blobstore?
  • npm start does not work in angular 5 anymore [duplicate]
  • Java: handling webcal protocol
  • YARN job history not coming
  • Send auth_token for authentication to ActionCable
  • Laravel4 : The requested resource /admin was not found on this server
  • How to write an SQL query that uses wild-card map to do transformation
  • PostgreSQL Full Text Search and Trigram Confusion
  • How to get “Confirm form resubmission” when user trying to refresh browser
  • Routing to SSR app
  • Help getting, or displaying, random records in ColdFusion from a MySQL query?
  • How to pass reference types by value?
  • How to hook Jackson ObjectMapper with Guice / Jersey
  • CMS for custom application
  • What's the difference between facet_wrap() and facet_grid() in ggplot2?
  • Is this select field really necessary if its not labeled/referenced?
  • php iphone/IOS6 upload rotation issue: what is best way to save rotated image
  • Why “continue” is considered as a C violation in MISRA C:2004?
  • Node application interactively get user input from react front end by pausing the current execution
  • openssl, chain of issuer certificates
  • One constructor - multiple arguments
  • Laravel 5 handle all errors
  • Post picture to facebook page album
  • Caching JTable rows
  • Problems with public directory when deploying Node.js app with Heroku
  • How to: get Date, Time and Time zone from single DateTimePicker Control
  • send restful request from Angular 2
  • FOR XML and Performance
  • Getting many values in an array in perl
  • Virtual Path in ASP.NET
  • htaccess: Redirect a Dynamic URL - Show only Static URL - Double Content
  • displaying save file dialog in ASP.NET
  • comp.lang.c faq: Function that can return a pointer to a function of the same type
  • Saving some info as a session in API Gateway or lambda
  • Django serving dynamic Files
  • Java Spark Framework: Use Straight HTML Template
  • Firebase: is possible to set a server-side timed deletion?
  • How to fit parametric equations to data points in Python
  • Make nvcc output traces on compile error
  • How to configure https support in 443 for apache AND node?
  • Physical Path for image saving. Asp.net
  • Is there any way to prevent Woocommerce from defaulting to one particular (local pickup) shipping me
  • Grails 2.3.0 view rendering issue
  • What is the advantage of using 'data-attribute' over $.data in jQuery?
  • What is this Objective-C/XCode annotation // [START_EXCLUDE]
  • Unable to make my Http Server multithreaded? I'm using Java HttpServer API
  • Returning a custom response code for for serving static html when using IIS ApplicationInitializatio
  • How to open href to local file?
  • Angular 4 + springboot + Maven + Eclipse - Have to build everytime
  • Setting Spring REST controllers base url without changing the static resources base url
  • Integrate Sass in Angular2 - webpack
  • Nginx: Setting a default file extension
  • 301 redirect .htaccess
  • Commonjs library's index.ts as external module
  • Going beyond the iframe
  • Upload file in appEngine really needed
  • Angular 2 i18n dynamic/instant translation
  • Sparkjava redirect while keeping the browser URL
  • Send a pull request for a specific folder?
  • ANTLR parser for alpha numeric words which may have whitespace in between
  • Understanding of back end file seeding to provide fast client downloads
  • Port mapping in Docker on Mac OSX installed with Docker Toolbox
  • default configuration change for SBT
  • app.yaml : wildcard in URL with static_dir?
  • Logical Error in Shell script.Please help (UNIX)
  • hapi single page application using inert plugin doesn't serve up api route
  • Determine the requested Controller in - ApplicationController
  • Convert VB's Val to Java?
  • PHP artisan serve shuts down after running once
  • Best practice for storing and searching applicant Résumé or CV file
  • Networkx : Convert multigraph into simple graph with weighted edges
  • Why is ::operator new[] necessary when ::operator new is enough?
  • Angular dynamically swap SASS styles depending on environment
  • After ng build in Angular 2 Cli application build the refresh shows 404 Error
  • Django admin not serving static files on Apache
  • Service worker doesn't return file from cache
  • How to run build version using create-react-app?
  • Cannot debug in VSCode by attaching to Chrome
  • The true meaning of django project and individual apps in it
  • handlebar is not changing when it is authenticated
  • What's the difference to use @staticmethod and global function in Python?
  • Relative paths to file issue in deploying an app
  • No HTTPS functions found. Use firebase functions:shell
  • Command to Stop infinte running Angular Server
  • Bigger projects Node.js and RESTful API
  • I uploaded a video to Google Cloud Storage via AppEngine. What's the most efficient way to serv
  • Where are the Android system services started?
  • Angular CLI 'ng serve' to ignore less and use available css
  • How to get the default Session for an Estimator in TensorFlow?
  • Problem with moving JSPs under WEB-INF directory
  • How to render template in route with params in Express?
  • downloaded zip file returns zero has 0 bytes as size
  • Which one is better: DMG or PackageMaker
  • Making my titan db graph with cassandra and elasticsearch backend
  • Capturing SQL STATISTICS TIME and IO into a table
  • Can't understand the Exception when using dynamic with generic collection in .net4
  • How to intercept a Url to dynamically change the routing
  • Prevent URL editing by users to restrict access to server's resources
  • “Angular 2 could not understand the value in View#template” using $event
  • Facebook Error (#200) The user hasn't authorized the application to perform this action
  • Django serving from media/ but not static/
  • Retrieve file from POST request with NanoHttpd
  • How to add dynamic member name and value to an instance of ExpandoObject class?
  • Jquery page transitions and SEO
  • Does my default app have to be deployed to appspot.com?
  • how to download .apk files from one Android app on button click?
  • Opening local files in MxGraph via urlParam
  • How to allow multiple connections to Dancer2
  • HibernateTemplate SaveOrUpdateAll
  • How to remove file type abbreviations in front of the file names in vs code explorer?
  • cannot find a module 'ng2-typeahead'
  • Bootstrap Angular 2 app with a provider that requires asynchronous initialization [duplicate]
  • wyswyg html form printing
  • jQuery .height() wrong in Safari
  • how does zookeeper do when the master down
  • Angular 5 Service worker not working / Doesn't cache background-image
  • ArrayList Search .net
  • Nginx 502 Bad Gateway error when using proxy
  • Inherit from two polymorphic classes
  • How to shuffle array in PostgreSQL 9.6 and also lower versions?
  • Foreach loop using string to output XML
  • Python program that checks wether an input has an int, float or bool
  • SimpleDateFormat fails to format Date interval?
  • How to configure karma and systemjs to run tests for angular ES6 transpiled by traceur into amd form
  • How to serve user-uploaded files on Swisscom Application Cloud?
  • Applescript folder actions support for changed / altered / updated files?
  • Ruby Rack Heroku: Serving Static Files
  • Can't add jvmArgs using add(), why?
  • Bug on Keras fit_generator, running few steps more than it should
  • Angular Module 'cordovaHTTP' is not available
  • WebEngine is not loading files linked in HTML (javafx)
  • Avoiding cookies while requesting static content
  • PHP - declare a global array
  • Exported variable 'router' has or is using name 'Router' from external module bu
  • Property 'x' is private and only accessible within class 'y'
  • vba Excel to Access: zero length string to Null number
  • Turn off dart2js during pub build
  • Create a JSON file from a Flask view to be used with D3
  • Unique ID across multiple SQL servers
  • docker-compose, export environnement variables are not working in Jenkins
  • Compress html output from zend framework 2
  • PBXCp error no such file or directory
  • How to store a database intensive page into cache from a background process in rails
  • Single Web API controller per resource or less controllers with more custom actions?
  • ASP.NET MVC Routing strategy for static content for each View
  • mod-rewrite rule for sitemap.xml
  • How to solve the serve static content from a cookieless domain in prestashop 1.5?
  • JavaScript execCommand('copy') not working
  • Why String.ToString()? [duplicate]
  • deploying Node.js app for production
  • Can I used mod_rewrite to change file extensions? .jpeg to .jpg for example
  • what can i do if for loop repeat single row from mysql database?
  • Cache is client side or server side?
  • Confused about how to update my datasources on my UITableView after app has been released
  • Eclipse > Javascript > Code highlighting not working with Object Notation
  • transpose 2D array that exists as IEnumerable of IEnumerable
  • Serving files from BlobStore in GAE
  • dropzone.js form submit not sending file
  • Django how to modify database records by template
  • Mapping C# classes to Lua functions via dll
  • Java ClassLoader Confusion
  • AOT and JIT with build-optimizer
  • A simple datepicker in VueJS
  • When interface inheritance in Java is useful?
  • Symfony2 redirect to https route fails (uses wrong port)
  • Zeromq with python hangs if connecting to invalid socket
  • Mercurial: Identify file name after rename
  • Granting permissions to Azure Active Directory Web Application automatically
  • Is there a way to call library thread-local init/cleanup on thread creation/destruction?
  • Problems with matplotlib.pyplot.xticks()
  • File extension of zlib zipped html page?
  • Cut the background to expose the layer below
  • What Makes These Two Array Adds Different?
  • Bigquery event streaming and table creation
  • IE11 throwing “SCRIPT1014: invalid character” where all other browsers work
  • Cannot upload to OneDrive using the new SDK
  • nonblocking BIO_do_connect blocked when there is no internet connected
  • Yii2: Config params vs. const/define
  • Get data from AJAX - How to
  • Change Inet root folder for iis 7
  • FB SDK and cURL: Unknown SSL protocol error in connection to graph.facebook.com:443
  • Using $this when not in object context
  • NetLogo BehaviorSpace - Measure runs using reporters
  • Spring security and special characters
  • How do I fake an specific browser client when using Java's Net library?
  • How reduce the height of an mschart by breaking up the y-axis
  • Bug in WPF DataGrid
  • Perl system calls when running as another user using sudo
  • JSON with duplicate key names losing information when parsed
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • AngularJs get employee from factory
  • Free memory of cv::Mat loaded using FileStorage API
  • C# - Getting references of reference
  • Memory offsets in inline assembly
  • Turn off referential integrity in Derby? is it possible?
  • How can I remove ASP.NET Designer.cs files?
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize