Improve company productivity with a Business Account.Sign Up

x

REST

238

Solutions

482

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am trying to build a REST API in .NET and are running into some issues. My service will use JSON Data which is send to the Server in the Body.
I Created a Data Class like
Public Class ADDR_VAL_REQUEST
        Private HEAD As ADDR_VAL_HEADER
        Private BODY As ADDR_VAL_BODY
End Class[

 Public Class ADDR_VAL_BODY

        Private AFT As String = ""
        Private LD3 As String = ""
        Private LV3 As String = ""
        Private CITY As String = ""
... and so on

Open in new window


and here my basic sample for the post

      Public Function PostValue(<FromBody()> ByVal value As ADDR_VAL_REQUEST) As String
            If ModelState.IsValid Then
                Console.Write(value.BODY.CITY)

                Return "OK"
            Else

                Return "Error"
            End If

        End Function

Open in new window


Which fails, if i only post the body it works and i can parse the city just fine. So my question what do i need to do to be able to pass
more complex data like mine. It even fails if i send data like this

{		 "ADDR_VAL_BODY": {
			 "LV3": "",
			 "CITY": "NEW YORK"
		}
}

Open in new window

but works for
 {
			 "LV3": "",
			 "CITY": "NEW YORK"
		}

Open in new window


So here is my question, ow do you handle cases where the Data is more complex like in my case ? If the build in parsing does not work, how do i go about to access the posted body to get the json string and parse it via code myself ?
0
Free Tool: Path Explorer
LVL 12
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I have been asked to stand up a weighted search appliance for a company.  The decision was to use SOLR to create the search tool so they can use the associated REST API for searches and recommendations.

I'm am still beginning in SOLR and have to ask a basic architecture question.  I have a table with 220 elements, 130 Million record strong.  I grow 5 million a year.

Does this become a Hadoop solution?  or can this still be done with a single SOLR engine?  I need to know which direction to start with so I do this right

Thanks much.
0
I have an HP EliteBook laptop that was getting a new image. This is a G2 laptop. Anyway I started the laptop image in the Microsoft System Center\software center. Selected the name-G2 - ME firmware - install bios - and googleDriveSync. I then selected and downloaded the ME updater. The firmware finished. Then in the bios I selected fast boot, PXE internal nic, PXE internal IPV4 nic, and under secure boot config I selected UEFI native without CSM then under device settings checked the box that said SATA device mode set to AHCI, VTx is checked  and G2 only then saved it. Then the user grabbed it before I could start the rest as I had to make a call to another user. She took the laptop and now it will not boot to any OS and goes to shut down mode. I was told that this would make a brick out of the laptop? Is there no way to get this laptop back to factory settings without a new motherboard being needed? This is really my question.
0
We cannot make a REST call using Classic ASP over TLS 1.2. This call is to get the authorization token from Paypal. We have tried lots of code variants with no success:

Example 1:
            Set xmlHttp = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico <== "Invalid procedure call or argument"
            xmlHttp.Send "grant_type=client_credentials"

Example 2:
            Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.6.0")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico
            xmlHttp.Send "grant_type=client_credentials"  <== "An error occurred in the secure channel support"

Also, we've been able to make it with .NET and with PHP at the same server.
0
Dear experts,

I have purchased a new touchscreen laptop HP Pavilion.

While working on the notepad I have seen that the screen moves upwards without me scrolling. What i mean is I observe this scrolling when I rest my wrist and palm on the screen to begin writing.

How do I ensure it does not scroll involuntarily. Can i lock it?

In the attached video I have simulated my experience through voluntary scrolling. My issue is it scrolls when i just rest my palm and when there is no scrolling.

Kindly guide.

Thank you
WhatsApp-Video-2018-04-13-at-05.54.1.mp4
0
Is there a way to search for e-mails / calendar items with a specific word in it like "registered" and remove that line only and keep the rest of the subject
Exchange / Office365
Example : [REGISTERED] - Realsubject
Remove the [REGISTERED] and keep Realsubject

Thanks in advance!
0
Hi,

I've set up a group policy which goes into Computer configuration>Admin templates>System>Windows Time Service>Time providers>Enabled both Configure Windows NTP Client, Enable Windows NTP Client and Enable Global configuration settings.

Under Configure Windows NTP Client I have selected Enabled and for NtpServer I have put in 2 DC's which I want the rest of the DC's to sync NTP with.

The hosts example: Core1 and Core2. These are both getting their NTP from:
time-a.nist.gov
time-b.nist.gov
time-nist.gov

I want the rest of the DC's in our environment to get their NTP from Core1 and Core2.

Core1 is running WS 2016
Core2 is a cisco switch
The rest of the DC's are running WS 2008 R2

So the problem is some of these dc's are getting the proper NTP servers after a gpupdate /force. I'm getting a few which are not applying the GPO. I've checked the group policy results on these machines and it's neither showing up as Applied or Denied.

 Anyone have any suggestions?
0
Want to post data on a rest api with given below code of vb6.  but fails.
 With Req
        .Open "POST", "http://202.166.207.75:9050/api/bill", async:=False
        .SetRequestHeader "Content-Type", "application/json; charset=utf-8"
        .SetRequestHeader "Accept", "application/json"
        Dim UNM As String
        Dim JSON As String
        JSON = Text13
        .Send JSON
       MsgBox CStr(.Status) & " " & .StatusText & vbNewLine _
                       & .GetAllResponseHeaders() & vbNewLine _
                       & String$(40, "-") & vbNewLine _
                       & .ResponseText
0
We have a wordpress website based on a template that we purchased years ago.  It has worked fine until recently. (I am not sure when it changed, as I don't check it often.)  My suspicion is that a Wordpress update resulted in the website appearing differently now.

It seems like there might be an issue with things that would normally appear grouped several to a row are now appearing with only one item per row.  For example, on this page - https://www.dsaengineering.com/ - there should be some pictures of featured projects under the title "FEATURED PROJECTS", but nothing seems to show.

Another example of the new problem is on the page https://www.dsaengineering.com/company/ all the Directors should fit on one row, and all the rest of the design professional should fit on one or maybe two rows, rather than only one person per row...

Thanks for any help that you can provide!
0
If i have a rest controller in spring boot how can I validate the contract that comes in if certain values of the parameters need to have certain values??? ANy code examples are appreciated!
0
Free Tool: ZipGrep
LVL 12
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I have an MS Access application that is hosted on a Remote Server.  One of the features I need to add is the ability to dial phone numbers and have looked at several solutions (as some of you know).  One of the solutions seems ideal as it will dial the required number and then call the users desk-phone (a common practice).  The service provider has a RESET API toolkit available, which looks ideal - but sadly, I have never worked with REST.  

So my question is this.  Will I be able to make a REST API call via VBA/Access as well as pull in the results  (connection time, engaged etc).
0
Hi Experts

Sorry people may be I mislead you. All what I want is how to include a productID range within Dsum

Dsum(“Closing”,”QryOpFinalstocks”,” [ProductID] = “ & Forms![<formname>]![<controlName>]& “ And [Warehouse ID] = “& Forms![<formname>]![<controlName>]& “ And [PPDate] <= “#& Forms![<formname>]![<controlName>]& “ #” )

I need that so that the selected code from the form query are picked correctly

How do we insert a product ID range in the above code??????????????

Regards

Chris
0
On excel, is there a way to lock certain cells, so the information in them can not be accidentally deleted while allowing the rest of the page to be modified?
0
Question: Is about Microsoft Windows Server 2016 Essentials, to save money can I run this with my main Firewall (software)?  I know there is a limit of 25 users and 50 devices, but I would only have 2 actual logins to maintain the box, the rest of the users would just be passing through the firewall.  Would this work? Is it licence complaint?
0
Hi,

I am a complete novice with REST APIs but have managed to connect to one using SOAPUI.

My next step is that I need to perform a similar connection using a powershell script.

So I need to connect using a Post method.

1. Obtain the authorization value
2. Use the value obtained as part of the authorization request as a "Request parameter" to make a Post call by using a pre-defined variable.
3. Use a further parameter to specify the data format i.e. json
0
Hi! I have a Crosstab showing the totals of my companies at my report footer. The problem is: I don't want the crosstab to be cut in half at the end of the paper, and to throw the rest of the information to next page. Is there anyway for me to set the cross tab to go to the other page automatically?

Thanks in advance
0
Will different Cryptographic Hashes (of same type)  return different values? I need to run a JavaScript version of a SHA-256 hash against some data client side. We will also have a rest api service running that needs to duplicate and produce the same hashes. I've read where certain version of a SHA-256 hash return different values based on who developed it and the platform. So how do we get around this? Also any recommendations for a specific version of SHA-256? The files will be small, 200-400 bytes each.

Thanks!
0
I'm currently using Roaster to generate a rest class, but i don't know how to implements http annotation (Get, Post,..) ?

Here's what I was trying to generate them with :

public class RestGenerator {
     public static void main(String[] args) {  

    JavaClassSource source = Roaster.create(JavaClassSource.class);
    source.setName("RestController").setPublic();
    source.addMethod().setName("Create").setPrivate().setBody("return null;")
    .addAnnotation();

    source.addMethod().setName("Delete").setPrivate().setBody("return null;")
    .addAnnotation();

    System.out.println(source);
}
}
output :

public class RestController
{

   @MISSING
   private void Create()
   {
      return null;
   }

   @MISSING
   private void Delete()
   {
      return null;
   }
0
We have one machine which cannot see the rest on the domain under the network tab in File Explorer.

We have checked Network Sharing is enabled, it can ping/browse the machines which are not showing up, it is on the correct range and is using the correct DNS, DHCP, and Gateway. I have tried setting these details to static and it is the same.  

It is running Windows 10 (as are all the client PCs) so we have tried the network reset option. And finally a system restore.

I still cannot see the other machines in this tab. We have recently started looking after this client and one of the things I have looked at is that they use a proxy server. This is configured and sent out to the machine under group policy. The policy has applied when I run a gpresult /r and the internet connects fine. I did notice when I dialled in and looked under Ethernet on the W10 network settings that it said action needed under the adapter. It needed the user credentials for the proxy. I entered these and it returned to say connected. I have not had this since after several reboots and the above troubleshooting steps.

Any help would be appreciated.
0
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Experts,

In a stored procedure we have a query that has worked in the past but no longer does on after we upgraded servers. The new server is SS2016.  It still works on our older 2012SQL Server.  Any type of options / settings that may have been that jump out at you? Or any reason at all whey we are suddenly encountering this.

Older version:

WHERE g.GCN_SEQNO = drug.GCN_SEQNO
        AND ISNUMERIC(drug.GCN_SEQNO) > 0

Note: the data  from g.GCN_SEQNO is all numeric. The data in the drug.GCN_SEQNO is a char field because it has one value = 'UNKNOWN'. The rest of the data is numeric format.


When we changed to a CASE statement or Try_cast, it works fine. So we solved for it, but just not sure why its not an issue.
Updated versionL

WHERE g.GCN_SEQNO = try_cast(drug.GCN_SEQNO as numeric(28,0))
0
Our company is moving some components to our internal cloud and I am working in a project and one of the task is to expose an existing legacy java class as soap web service. Can anyone please help me stir in the right direction? How can  I write a soap Producer on existing new class and methods? Should I write a new class and extend this class or should I write a subclass? What is the best  way  to approach  this?I  am new  to integration projects. The company is using  Mule  Esb as an integration solution? Also how Mule esb fitst together  with all this?I am new to  Mule  esb.
0
Can I use the Telegram Bot API for listetning to message on a private invite-only channel?

Background information:
I was hired to do a gig for doing a Telegram bot that could parse messages and saved them into plain text. Now, I was told that the bot is required to listen to message in invite-only  channels. While doing some research, looks like this is a bit of an issue. I heard some suggest to use the Telegram Client API (instead of Bot), can someone confirm this is possible on the Bot API, or if I actually ave to switch towards Client?
0
Multi-part form data is not accepting in jersey API. When I am not setting the content header explicitly it is giving 'Unsupported Media Type' and when I am setting the header explicitly to multi part-form data it is giving CORS error.

Angular Calling :

 
  private headers1 = new Headers({'Content-Type' : 'multipart/form-data'});

      sendFile(fileObj: File){
       // alert(fileObj);
        return this._http.post(this.baseURL+'/submitexcel',fileObj,{headers : this.headers1}).map(res => res.json().data).subscribe();

        }

 }

Open in new window

JAVA API :
 @POST
               @Path("/submitexcel")
                @Consumes(MediaType.MULTIPART_FORM_DATA)
                public Response uploadFile(

                        @FormDataParam("file") InputStream uploadedInputStream,
                        @FormDataParam("file") FormDataContentDisposition fileDetail) {
                    // check if all form parameters are provided
                   System.out.println("CAssked");
                    if (uploadedInputStream == null || fileDetail == null)
                        return Response.status(400).entity("Invalid form data").build();
                    // create our destination folder, if it not exists
                    try {
                        createFolderIfNotExists(UPLOAD_FOLDER);
                    } catch (SecurityException se) {
                        System.out.println("Can not create destination folder on server");
          

Open in new window

0
I have an existing Visual Studio 2013 ASP.NET MVC web service app that works fine on Dev Server A.  I can launch and debug the web service and everything works properly.

I am setting up the project on a new server, Dev Server B, trying to match the configuration of Server A.  The Visual Studio code has not been changed.  I have the code working and debugging on Dev Server B, but one of the controller methods is not working for some reason.  The other controller methods work fine.

If I access the URL on Dev Server B:

http://localhost:1881/DynamicsIntegration/CheckStatus2

I get this error: The resource cannot be found HTTP 404

Resource cannot be found

Strangely, if I rename the method name in the controller to anything else, it works fine.  CheckStatus1, CheckStatusA, etc. work fine.  But "CheckStatus2" does not work.

CheckStatus2
When this error occurs, no breakpoints are hit in the CheckStatus2 code, and no breakpoints in the controller are not hit.  When I rename the method, it works fine.

I don't think I have any routing setup, and haven't been able to find anything that may be causing "CheckStatus2" to be an invalid route.  My assumption is that something is getting cached in IIS or some routing hint is causing the problem, but I can't find any clues.

How can I troubleshoot this or track down the problem?
0
The scenario is that I have a PHP function which makes call through third party library to a third party url and it is noticed that it gets timeout due to heavy traffic.

I have put a Circuit is open check condition in my try block and in catch block I have added code to raise exception in circuit breaker library i.e. whenever I get Connection timeouts Exception from third party library I raise a PHP exception in circuit breaker command by passing a boolean flag.

The issue I am getting is that short circuits happens at requests early than the threshold.

With below configurations only for this command

'circuitBreaker' => array(
   'errorThresholdPercentage' => 50,
   'requestVolumeThreshold' => 10,
   'sleepWindowInMilliseconds' => 10000,
   'rollingStatisticalWindowInMilliseconds' => 20000,
)
0

REST

238

Solutions

482

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.

Top Experts In
REST
<
Monthly
>