http-status-code-400

Java - HTTP Post Jira API - Bad Request

你说的曾经没有我的故事 提交于 2020-07-28 04:01:10
问题 I have this code to do a HTTP Post to a Jira URL ( https://xxxxxxx.atlassian.net/rest/api/2/issue/ ): Object jsonMessage = arg0.getMessage().getPayload(); URL url = new URL(jiraUrl + jiraIssuePath); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); BASE64Encoder enc = new sun.misc.BASE64Encoder(); String userpassword = jiraUsername + ":" + jiraPassword; String encodedAuthorization = enc.encode(userpassword.getBytes()); conn.setDoOutput(true); conn.setDoInput(true); conn

Java - HTTP Post Jira API - Bad Request

随声附和 提交于 2020-07-28 03:58:20
问题 I have this code to do a HTTP Post to a Jira URL ( https://xxxxxxx.atlassian.net/rest/api/2/issue/ ): Object jsonMessage = arg0.getMessage().getPayload(); URL url = new URL(jiraUrl + jiraIssuePath); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); BASE64Encoder enc = new sun.misc.BASE64Encoder(); String userpassword = jiraUsername + ":" + jiraPassword; String encodedAuthorization = enc.encode(userpassword.getBytes()); conn.setDoOutput(true); conn.setDoInput(true); conn

Converting Stripe API syntax to Google Apps Script

醉酒当歌 提交于 2020-07-22 05:50:32
问题 This SO answer correctly explains that since the require Node/JS library is not supported by Google Apps Script, the following code changes must be made to get Stripe to work properly in a GAS project: from const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); (async () => { const product = await stripe.products.create({ name: 'My SaaS Platform', type: 'service', }); })(); to function myFunction() { var url = "https://api.stripe.com/v1/products"; var params = { method: "post",

What are the possible reasons to get APNs responses BadDeviceToken or Unregistered?

时光怂恿深爱的人放手 提交于 2020-06-09 11:44:17
问题 When sending notifications to iOS users, for some of them I get response status code 400 (BadDeviceToken) or code 410 (Unregistered). From Apple documentation about "BadDeviceToken": The specified device token was bad. Verify that the request contains a valid token and that the token matches the environment. What is the meaning of "bad"? I know for a fact that the device token was valid at some earlier time. What does a user do to make its device token bad? From documentation about

Why would I get, “The remote server returned an error: (400) Bad Request” with this code?

回眸只為那壹抹淺笑 提交于 2020-01-16 17:34:09
问题 I was first getting "Unable to connect to the remote server" but then remembered that I couldn't use "localhost" from a handheld device. I swapped that out with the name of the machine like so: String uri = String.Format(@"http://PLATYPUS:21608/api/inventory/sendXML/woodrow/gus/{0}", fileName); //I reckon I could also use the IP address in place of the machine name, but probably would make no difference ...and now I get, " The remote server returned an error: (400) Bad Request " The same

Using a WebClient and C#, how do I get returned data even when the response is (400) Bad Request?

走远了吗. 提交于 2020-01-12 07:06:32
问题 I am using the Google Translate API and am trying to capture the data returned when I get an error. (FYI: I know the API Key is wrong, I am just testing this). The issue is that the browser, as you can see by clicking the link, displays the error info, but C# throws a WebException and I can't seem to get the response data. Here is my code: string url = "https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q=Hello%20world"; WebClient clnt = new WebClient();

Using a WebClient and C#, how do I get returned data even when the response is (400) Bad Request?

我们两清 提交于 2020-01-12 07:05:46
问题 I am using the Google Translate API and am trying to capture the data returned when I get an error. (FYI: I know the API Key is wrong, I am just testing this). The issue is that the browser, as you can see by clicking the link, displays the error info, but C# throws a WebException and I can't seem to get the response data. Here is my code: string url = "https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q=Hello%20world"; WebClient clnt = new WebClient();

Etsy API Image upload error

孤街浪徒 提交于 2020-01-06 03:37:24
问题 I have an oauth connection - it works well with all other requests, but one: upload image for listings. Here is the code: $connection = $this->getEtsyConnection(); $imageApiUrl = 'https://openapi.etsy.com/v2/listings/'.$listingId.'/images'; $mimeType = mime_content_type($source_file); $filesize = filesize($source_file); $params = ['@image' => ''.$source_file.';type='.$mimeType, 'rank'=>1, 'overwrite'=>true, 'listing_id'=>intval($listingId) ]; $header = [ 'Content-Type' => 'multipart/form-data

Web-Api 400 BadRequest when search parameter is blank

僤鯓⒐⒋嵵緔 提交于 2020-01-05 11:57:25
问题 I am using web-api with mvc4 I am making searching functionality, in some cases like if i filter data then remove that textbox value and then press search button, need to show whole listing but in my case showing 400 bad request. as search parameter is blank, i know if search parameter blank then it will throw 400 error with web-api. any one have proper solution then please let me know. data: "CurrPage=" + JsCurrPage + "&PageSize=" + parseInt(pagesize) + "&BuildTypeName=" + $("#BuildTypeName"